Browse Source

Merge pull request #6348 from thinkyhead/rc_tmc2130_clean_clean

TMC2130 update. Fixes, tune-ups, new features
Scott Lahteine 7 years ago
parent
commit
8cccf69ef7
50 changed files with 2002 additions and 804 deletions
  1. 1
    1
      .travis.yml
  2. 1
    1
      Marlin/Configuration.h
  3. 80
    33
      Marlin/Configuration_adv.h
  4. 226
    51
      Marlin/Marlin_main.cpp
  5. 18
    0
      Marlin/SanityCheck.h
  6. 10
    10
      Marlin/configuration_store.cpp
  7. 1
    1
      Marlin/example_configurations/Cartesio/Configuration.h
  8. 80
    33
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  9. 1
    1
      Marlin/example_configurations/Felix/Configuration.h
  10. 80
    33
      Marlin/example_configurations/Felix/Configuration_adv.h
  11. 1
    1
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  12. 1
    1
      Marlin/example_configurations/Hephestos/Configuration.h
  13. 80
    33
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  14. 1
    1
      Marlin/example_configurations/Hephestos_2/Configuration.h
  15. 80
    33
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  16. 1
    1
      Marlin/example_configurations/K8200/Configuration.h
  17. 80
    33
      Marlin/example_configurations/K8200/Configuration_adv.h
  18. 1
    1
      Marlin/example_configurations/K8400/Configuration.h
  19. 80
    33
      Marlin/example_configurations/K8400/Configuration_adv.h
  20. 1
    1
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  21. 1
    1
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  22. 1
    1
      Marlin/example_configurations/RigidBot/Configuration.h
  23. 80
    33
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  24. 1
    1
      Marlin/example_configurations/SCARA/Configuration.h
  25. 80
    33
      Marlin/example_configurations/SCARA/Configuration_adv.h
  26. 1
    1
      Marlin/example_configurations/TAZ4/Configuration.h
  27. 80
    33
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  28. 1
    1
      Marlin/example_configurations/TinyBoy2/Configuration.h
  29. 80
    33
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  30. 1
    1
      Marlin/example_configurations/WITBOX/Configuration.h
  31. 80
    33
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  32. 1
    1
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  33. 1
    1
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h
  34. 85
    34
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  35. 1
    1
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h
  36. 80
    33
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  37. 1
    1
      Marlin/example_configurations/delta/generic/Configuration.h
  38. 80
    33
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  39. 1
    1
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  40. 80
    33
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  41. 1
    1
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  42. 80
    33
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  43. 1
    1
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  44. 80
    33
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  45. 1
    1
      Marlin/example_configurations/makibox/Configuration.h
  46. 80
    33
      Marlin/example_configurations/makibox/Configuration_adv.h
  47. 1
    1
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  48. 80
    33
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  49. 80
    33
      Marlin/example_configurations/wt150/Configuration_adv.h
  50. 38
    24
      Marlin/stepper_indirection.cpp

+ 1
- 1
.travis.yml View File

409
   - restore_configs
409
   - restore_configs
410
   - opt_enable_adv HAVE_TMC2130 X_IS_TMC2130 Y_IS_TMC2130 Z_IS_TMC2130
410
   - opt_enable_adv HAVE_TMC2130 X_IS_TMC2130 Y_IS_TMC2130 Z_IS_TMC2130
411
   - build_marlin
411
   - build_marlin
412
-  - opt_enable_adv AUTOMATIC_CURRENT_CONTROL STEALTHCHOP
412
+  - opt_enable_adv AUTOMATIC_CURRENT_CONTROL STEALTHCHOP HYBRID_THRESHOLD SENSORLESS_HOMING
413
   - build_marlin
413
   - build_marlin
414
   #
414
   #
415
   # tvrrug Config need to check board type for sanguino atmega644p
415
   # tvrrug Config need to check board type for sanguino atmega644p

+ 1
- 1
Marlin/Configuration.h View File

1522
  * Enable support for an RGB LED connected to 5V digital pins, or
1522
  * Enable support for an RGB LED connected to 5V digital pins, or
1523
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1523
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1524
  *
1524
  *
1525
- * Adds the M150 command to set the LED (or LED strip) color. 
1525
+ * Adds the M150 command to set the LED (or LED strip) color.
1526
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1526
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1527
  * luminance values can be set from 0 to 255.
1527
  * luminance values can be set from 0 to 255.
1528
  *
1528
  *

+ 80
- 33
Marlin/Configuration_adv.h View File

882
 //#define HAVE_TMC2130
882
 //#define HAVE_TMC2130
883
 
883
 
884
 #if ENABLED(HAVE_TMC2130)
884
 #if ENABLED(HAVE_TMC2130)
885
-  #define STEALTHCHOP
886
-
887
-  /**
888
-   * Let Marlin automatically control stepper current.
889
-   * This is still an experimental feature.
890
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
891
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
892
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
893
-   */
894
-  //#define AUTOMATIC_CURRENT_CONTROL
895
-  #define CURRENT_STEP          50  // [mA]
896
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
897
 
885
 
898
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
886
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
899
   //#define X_IS_TMC2130
887
   //#define X_IS_TMC2130
916
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
904
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
917
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
905
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
918
 
906
 
919
-  #define X_MAX_CURRENT     1000  // rms current in mA
920
-  #define X_MICROSTEPS        16  // FULLSTEP..256
921
-  #define X_CHIP_SELECT       40  // Pin
907
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
908
+  #define X_MICROSTEPS        16  // 0..256
922
 
909
 
923
-  #define Y_MAX_CURRENT     1000
910
+  #define Y_CURRENT         1000
924
   #define Y_MICROSTEPS        16
911
   #define Y_MICROSTEPS        16
925
-  #define Y_CHIP_SELECT       42
926
 
912
 
927
-  #define Z_MAX_CURRENT     1000
913
+  #define Z_CURRENT         1000
928
   #define Z_MICROSTEPS        16
914
   #define Z_MICROSTEPS        16
929
-  #define Z_CHIP_SELECT       65
930
 
915
 
931
-  //#define X2_MAX_CURRENT  1000
916
+  //#define X2_CURRENT      1000
932
   //#define X2_MICROSTEPS     16
917
   //#define X2_MICROSTEPS     16
933
-  //#define X2_CHIP_SELECT    -1
934
 
918
 
935
-  //#define Y2_MAX_CURRENT  1000
919
+  //#define Y2_CURRENT      1000
936
   //#define Y2_MICROSTEPS     16
920
   //#define Y2_MICROSTEPS     16
937
-  //#define Y2_CHIP_SELECT    -1
938
 
921
 
939
-  //#define Z2_MAX_CURRENT  1000
922
+  //#define Z2_CURRENT      1000
940
   //#define Z2_MICROSTEPS     16
923
   //#define Z2_MICROSTEPS     16
941
-  //#define Z2_CHIP_SELECT    -1
942
 
924
 
943
-  //#define E0_MAX_CURRENT  1000
925
+  //#define E0_CURRENT      1000
944
   //#define E0_MICROSTEPS     16
926
   //#define E0_MICROSTEPS     16
945
-  //#define E0_CHIP_SELECT    -1
946
 
927
 
947
-  //#define E1_MAX_CURRENT  1000
928
+  //#define E1_CURRENT      1000
948
   //#define E1_MICROSTEPS     16
929
   //#define E1_MICROSTEPS     16
949
-  //#define E1_CHIP_SELECT    -1
950
 
930
 
951
-  //#define E2_MAX_CURRENT  1000
931
+  //#define E2_CURRENT      1000
952
   //#define E2_MICROSTEPS     16
932
   //#define E2_MICROSTEPS     16
953
-  //#define E2_CHIP_SELECT    -1
954
 
933
 
955
-  //#define E3_MAX_CURRENT  1000
934
+  //#define E3_CURRENT      1000
956
   //#define E3_MICROSTEPS     16
935
   //#define E3_MICROSTEPS     16
957
-  //#define E3_CHIP_SELECT    -1
936
+
937
+  //#define E4_CURRENT      1000
938
+  //#define E4_MICROSTEPS     16
939
+
940
+  /**
941
+   * Use Trinamic's ultra quiet stepping mode.
942
+   * When disabled, Marlin will use spreadCycle stepping mode.
943
+   */
944
+  #define STEALTHCHOP
945
+
946
+  /**
947
+   * Let Marlin automatically control stepper current.
948
+   * This is still an experimental feature.
949
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
950
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
951
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
952
+   * Relevant g-codes:
953
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
954
+   * M906 S1 - Start adjusting current
955
+   * M906 S0 - Stop adjusting current
956
+   * M911 - Report stepper driver overtemperature pre-warn condition.
957
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
958
+   */
959
+  //#define AUTOMATIC_CURRENT_CONTROL
960
+
961
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
962
+    #define CURRENT_STEP          50  // [mA]
963
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
964
+    #define REPORT_CURRENT_CHANGE
965
+  #endif
966
+
967
+  /**
968
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
969
+   * This mode allows for faster movements at the expense of higher noise levels.
970
+   * STEALTHCHOP needs to be enabled.
971
+   * M913 X/Y/Z/E to live tune the setting
972
+   */
973
+  //#define HYBRID_THRESHOLD
974
+
975
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
976
+  #define X2_HYBRID_THRESHOLD    100
977
+  #define Y_HYBRID_THRESHOLD     100
978
+  #define Y2_HYBRID_THRESHOLD    100
979
+  #define Z_HYBRID_THRESHOLD       4
980
+  #define Z2_HYBRID_THRESHOLD      4
981
+  #define E0_HYBRID_THRESHOLD     30
982
+  #define E1_HYBRID_THRESHOLD     30
983
+  #define E2_HYBRID_THRESHOLD     30
984
+  #define E3_HYBRID_THRESHOLD     30
985
+  #define E4_HYBRID_THRESHOLD     30
986
+
987
+  /**
988
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
989
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
990
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
991
+   *
992
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
993
+   * Higher values make the system LESS sensitive.
994
+   * Lower value make the system MORE sensitive.
995
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
996
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
997
+   * M914 X/Y to live tune the setting
998
+   */
999
+  //#define SENSORLESS_HOMING
1000
+
1001
+  #if ENABLED(SENSORLESS_HOMING)
1002
+    #define X_HOMING_SENSITIVITY  19
1003
+    #define Y_HOMING_SENSITIVITY  19
1004
+  #endif
958
 
1005
 
959
   /**
1006
   /**
960
    * You can set your own advanced settings by filling in predefined functions.
1007
    * You can set your own advanced settings by filling in predefined functions.

+ 226
- 51
Marlin/Marlin_main.cpp View File

198
  * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT)
198
  * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT)
199
  * M911 - Report stepper driver overtemperature pre-warn condition. (Requires HAVE_TMC2130)
199
  * M911 - Report stepper driver overtemperature pre-warn condition. (Requires HAVE_TMC2130)
200
  * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires HAVE_TMC2130)
200
  * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires HAVE_TMC2130)
201
+ * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD)
202
+ * M914 - Set SENSORLESS_HOMING sensitivity. (Requires SENSORLESS_HOMING)
201
  * M350 - Set microstepping mode. (Requires digital microstepping pins.)
203
  * M350 - Set microstepping mode. (Requires digital microstepping pins.)
202
  * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.)
204
  * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.)
203
  *
205
  *
647
   bool chdkActive = false;
649
   bool chdkActive = false;
648
 #endif
650
 #endif
649
 
651
 
652
+#ifdef AUTOMATIC_CURRENT_CONTROL
653
+  bool auto_current_control = 0;
654
+#endif
655
+
650
 #if ENABLED(PID_EXTRUSION_SCALING)
656
 #if ENABLED(PID_EXTRUSION_SCALING)
651
   int lpq_len = 20;
657
   int lpq_len = 20;
652
 #endif
658
 #endif
2757
 }
2763
 }
2758
 
2764
 
2759
 /**
2765
 /**
2766
+ * TMC2130 specific sensorless homing using stallGuard2.
2767
+ * stallGuard2 only works when in spreadCycle mode.
2768
+ * spreadCycle and stealthChop are mutually exclusive.
2769
+ */
2770
+#if ENABLED(SENSORLESS_HOMING)
2771
+  void tmc2130_sensorless_homing(TMC2130Stepper &st, bool enable=true) {
2772
+    #if ENABLED(STEALTHCHOP)
2773
+      if (enable) {
2774
+        st.coolstep_min_speed(1024UL * 1024UL - 1UL);
2775
+        st.stealthChop(0);
2776
+      }
2777
+      else {
2778
+        st.coolstep_min_speed(0);
2779
+        st.stealthChop(1);
2780
+      }
2781
+    #endif
2782
+
2783
+    st.diag1_stall(enable ? 1 : 0);
2784
+  }
2785
+#endif
2786
+
2787
+/**
2760
  * Home an individual "raw axis" to its endstop.
2788
  * Home an individual "raw axis" to its endstop.
2761
  * This applies to XYZ on Cartesian and Core robots, and
2789
  * This applies to XYZ on Cartesian and Core robots, and
2762
  * to the individual ABC steppers on DELTA and SCARA.
2790
  * to the individual ABC steppers on DELTA and SCARA.
2804
     if (axis == Z_AXIS) stepper.set_homing_flag(true);
2832
     if (axis == Z_AXIS) stepper.set_homing_flag(true);
2805
   #endif
2833
   #endif
2806
 
2834
 
2835
+  // Disable stealthChop if used. Enable diag1 pin on driver.
2836
+  #if ENABLED(SENSORLESS_HOMING)
2837
+    #if ENABLED(X_IS_TMC2130)
2838
+      if (axis == X_AXIS) tmc2130_sensorless_homing(stepperX);
2839
+    #endif
2840
+    #if ENABLED(Y_IS_TMC2130)
2841
+      if (axis == Y_AXIS) tmc2130_sensorless_homing(stepperY);
2842
+    #endif
2843
+  #endif
2844
+
2807
   // Fast move towards endstop until triggered
2845
   // Fast move towards endstop until triggered
2808
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2846
   #if ENABLED(DEBUG_LEVELING_FEATURE)
2809
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:");
2847
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:");
2888
 
2926
 
2889
   #endif
2927
   #endif
2890
 
2928
 
2929
+  // Re-enable stealthChop if used. Disable diag1 pin on driver.
2930
+  #if ENABLED(SENSORLESS_HOMING)
2931
+    #if ENABLED(X_IS_TMC2130)
2932
+      if (axis == X_AXIS) tmc2130_sensorless_homing(stepperX, false);
2933
+    #endif
2934
+    #if ENABLED(Y_IS_TMC2130)
2935
+      if (axis == Y_AXIS) tmc2130_sensorless_homing(stepperY, false);
2936
+    #endif
2937
+  #endif
2938
+
2891
   // Put away the Z probe
2939
   // Put away the Z probe
2892
   #if HOMING_Z_WITH_PROBE
2940
   #if HOMING_Z_WITH_PROBE
2893
     if (axis == Z_AXIS && STOW_PROBE()) return;
2941
     if (axis == Z_AXIS && STOW_PROBE()) return;
6902
       OUT_WRITE(SUICIDE_PIN, HIGH);
6950
       OUT_WRITE(SUICIDE_PIN, HIGH);
6903
     #endif
6951
     #endif
6904
 
6952
 
6953
+    #if ENABLED(HAVE_TMC2130)
6954
+      delay(100);
6955
+      tmc2130_init(); // Settings only stick when the driver has power
6956
+    #endif
6957
+
6905
     #if ENABLED(ULTIPANEL)
6958
     #if ENABLED(ULTIPANEL)
6906
       powersupply = true;
6959
       powersupply = true;
6907
       LCD_MESSAGEPGM(WELCOME_MSG);
6960
       LCD_MESSAGEPGM(WELCOME_MSG);
8770
 
8823
 
8771
 #if ENABLED(HAVE_TMC2130)
8824
 #if ENABLED(HAVE_TMC2130)
8772
 
8825
 
8773
-  static void tmc2130_print_current(const int mA, const char name) {
8826
+  static void tmc2130_get_current(TMC2130Stepper &st, const char name) {
8774
     SERIAL_CHAR(name);
8827
     SERIAL_CHAR(name);
8775
     SERIAL_ECHOPGM(" axis driver current: ");
8828
     SERIAL_ECHOPGM(" axis driver current: ");
8776
-    SERIAL_ECHOLN(mA);
8829
+    SERIAL_ECHOLN(st.getCurrent());
8777
   }
8830
   }
8778
-  static void tmc2130_set_current(const int mA, TMC2130Stepper &st, const char name) {
8779
-    tmc2130_print_current(mA, name);
8780
-    st.setCurrent(mA, 0.11, 0.5);
8781
-  }
8782
-  static void tmc2130_get_current(TMC2130Stepper &st, const char name) {
8783
-    tmc2130_print_current(st.getCurrent(), name);
8831
+  static void tmc2130_set_current(TMC2130Stepper &st, const char name, const int mA) {
8832
+    st.setCurrent(mA, R_SENSE, HOLD_MULTIPLIER);
8833
+    tmc2130_get_current(st, name);
8784
   }
8834
   }
8835
+
8785
   static void tmc2130_report_otpw(TMC2130Stepper &st, const char name) {
8836
   static void tmc2130_report_otpw(TMC2130Stepper &st, const char name) {
8786
     SERIAL_CHAR(name);
8837
     SERIAL_CHAR(name);
8787
     SERIAL_ECHOPGM(" axis temperature prewarn triggered: ");
8838
     SERIAL_ECHOPGM(" axis temperature prewarn triggered: ");
8788
     serialprintPGM(st.getOTPW() ? PSTR("true") : PSTR("false"));
8839
     serialprintPGM(st.getOTPW() ? PSTR("true") : PSTR("false"));
8840
+    SERIAL_EOL;
8789
   }
8841
   }
8790
   static void tmc2130_clear_otpw(TMC2130Stepper &st, const char name) {
8842
   static void tmc2130_clear_otpw(TMC2130Stepper &st, const char name) {
8791
     st.clear_otpw();
8843
     st.clear_otpw();
8793
     SERIAL_ECHOLNPGM(" prewarn flag cleared");
8845
     SERIAL_ECHOLNPGM(" prewarn flag cleared");
8794
   }
8846
   }
8795
 
8847
 
8848
+  static void tmc2130_get_pwmthrs(TMC2130Stepper &st, const char name, const uint16_t spmm) {
8849
+    SERIAL_CHAR(name);
8850
+    SERIAL_ECHOPGM(" stealthChop max speed set to ");
8851
+    SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.stealth_max_speed() * spmm));
8852
+  }
8853
+  static void tmc2130_set_pwmthrs(TMC2130Stepper &st, const char name, const int32_t thrs, const uint32_t spmm) {
8854
+    st.stealth_max_speed(12650000UL * st.microsteps() / (256 * thrs * spmm));
8855
+    tmc2130_get_pwmthrs(st, name, spmm);
8856
+  }
8857
+
8858
+  static void tmc2130_get_sgt(TMC2130Stepper &st, const char name) {
8859
+    SERIAL_CHAR(name);
8860
+    SERIAL_ECHOPGM(" driver homing sensitivity set to ");
8861
+    SERIAL_ECHOLN(st.sgt());
8862
+  }
8863
+  static void tmc2130_set_sgt(TMC2130Stepper &st, const char name, const int8_t sgt_val) {
8864
+    st.sgt(sgt_val);
8865
+    tmc2130_get_sgt(st, name);
8866
+  }
8867
+
8796
   /**
8868
   /**
8797
    * M906: Set motor current in milliamps using axis codes X, Y, Z, E
8869
    * M906: Set motor current in milliamps using axis codes X, Y, Z, E
8798
-   *
8799
    * Report driver currents when no axis specified
8870
    * Report driver currents when no axis specified
8871
+   *
8872
+   * S1: Enable automatic current control
8873
+   * S0: Disable
8800
    */
8874
    */
8801
   inline void gcode_M906() {
8875
   inline void gcode_M906() {
8802
     uint16_t values[XYZE];
8876
     uint16_t values[XYZE];
8804
       values[i] = code_seen(axis_codes[i]) ? code_value_int() : 0;
8878
       values[i] = code_seen(axis_codes[i]) ? code_value_int() : 0;
8805
 
8879
 
8806
     #if ENABLED(X_IS_TMC2130)
8880
     #if ENABLED(X_IS_TMC2130)
8807
-      if (values[X_AXIS]) tmc2130_set_current(values[X_AXIS], stepperX, 'X');
8881
+      if (values[X_AXIS]) tmc2130_set_current(stepperX, 'X', values[X_AXIS]);
8808
       else tmc2130_get_current(stepperX, 'X');
8882
       else tmc2130_get_current(stepperX, 'X');
8809
     #endif
8883
     #endif
8810
     #if ENABLED(Y_IS_TMC2130)
8884
     #if ENABLED(Y_IS_TMC2130)
8811
-      if (values[Y_AXIS]) tmc2130_set_current(values[Y_AXIS], stepperY, 'Y');
8885
+      if (values[Y_AXIS]) tmc2130_set_current(stepperY, 'Y', values[Y_AXIS]);
8812
       else tmc2130_get_current(stepperY, 'Y');
8886
       else tmc2130_get_current(stepperY, 'Y');
8813
     #endif
8887
     #endif
8814
     #if ENABLED(Z_IS_TMC2130)
8888
     #if ENABLED(Z_IS_TMC2130)
8815
-      if (values[Z_AXIS]) tmc2130_set_current(values[Z_AXIS], stepperZ, 'Z');
8889
+      if (values[Z_AXIS]) tmc2130_set_current(stepperZ, 'Z', values[Z_AXIS]);
8816
       else tmc2130_get_current(stepperZ, 'Z');
8890
       else tmc2130_get_current(stepperZ, 'Z');
8817
     #endif
8891
     #endif
8818
     #if ENABLED(E0_IS_TMC2130)
8892
     #if ENABLED(E0_IS_TMC2130)
8819
-      if (values[E_AXIS]) tmc2130_set_current(values[E_AXIS], stepperE0, 'E');
8893
+      if (values[E_AXIS]) tmc2130_set_current(stepperE0, 'E', values[E_AXIS]);
8820
       else tmc2130_get_current(stepperE0, 'E');
8894
       else tmc2130_get_current(stepperE0, 'E');
8821
     #endif
8895
     #endif
8896
+
8897
+    #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
8898
+      if (code_seen('S')) auto_current_control = code_value_bool();
8899
+    #endif
8822
   }
8900
   }
8823
 
8901
 
8824
   /**
8902
   /**
8826
    * The flag is held by the library and persist until manually cleared by M912
8904
    * The flag is held by the library and persist until manually cleared by M912
8827
    */
8905
    */
8828
   inline void gcode_M911() {
8906
   inline void gcode_M911() {
8907
+    const bool reportX = code_seen('X'), reportY = code_seen('Y'), reportZ = code_seen('Z'), reportE = code_seen('E'),
8908
+             reportAll = (!reportX && !reportY && !reportZ && !reportE) || (reportX && reportY && reportZ && reportE);
8829
     #if ENABLED(X_IS_TMC2130)
8909
     #if ENABLED(X_IS_TMC2130)
8830
-      tmc2130_report_otpw(stepperX, 'X');
8910
+      if (reportX || reportAll) tmc2130_report_otpw(stepperX, 'X');
8831
     #endif
8911
     #endif
8832
     #if ENABLED(Y_IS_TMC2130)
8912
     #if ENABLED(Y_IS_TMC2130)
8833
-      tmc2130_report_otpw(stepperY, 'Y');
8913
+      if (reportY || reportAll) tmc2130_report_otpw(stepperY, 'Y');
8834
     #endif
8914
     #endif
8835
     #if ENABLED(Z_IS_TMC2130)
8915
     #if ENABLED(Z_IS_TMC2130)
8836
-      tmc2130_report_otpw(stepperZ, 'Z');
8916
+      if (reportZ || reportAll) tmc2130_report_otpw(stepperZ, 'Z');
8837
     #endif
8917
     #endif
8838
     #if ENABLED(E0_IS_TMC2130)
8918
     #if ENABLED(E0_IS_TMC2130)
8839
-      tmc2130_report_otpw(stepperE0, 'E');
8919
+      if (reportE || reportAll) tmc2130_report_otpw(stepperE0, 'E');
8840
     #endif
8920
     #endif
8841
   }
8921
   }
8842
 
8922
 
8844
    * M912: Clear TMC2130 stepper driver overtemperature pre-warn flag held by the library
8924
    * M912: Clear TMC2130 stepper driver overtemperature pre-warn flag held by the library
8845
    */
8925
    */
8846
   inline void gcode_M912() {
8926
   inline void gcode_M912() {
8927
+    const bool clearX = code_seen('X'), clearY = code_seen('Y'), clearZ = code_seen('Z'), clearE = code_seen('E'),
8928
+             clearAll = (!clearX && !clearY && !clearZ && !clearE) || (clearX && clearY && clearZ && clearE);
8847
     #if ENABLED(X_IS_TMC2130)
8929
     #if ENABLED(X_IS_TMC2130)
8848
-      if (code_seen('X')) tmc2130_clear_otpw(stepperX, 'X');
8930
+      if (clearX || clearAll) tmc2130_clear_otpw(stepperX, 'X');
8849
     #endif
8931
     #endif
8850
     #if ENABLED(Y_IS_TMC2130)
8932
     #if ENABLED(Y_IS_TMC2130)
8851
-      if (code_seen('Y')) tmc2130_clear_otpw(stepperY, 'Y');
8933
+      if (clearY || clearAll) tmc2130_clear_otpw(stepperY, 'Y');
8852
     #endif
8934
     #endif
8853
     #if ENABLED(Z_IS_TMC2130)
8935
     #if ENABLED(Z_IS_TMC2130)
8854
-      if (code_seen('Z')) tmc2130_clear_otpw(stepperZ, 'Z');
8936
+      if (clearZ || clearAll) tmc2130_clear_otpw(stepperZ, 'Z');
8855
     #endif
8937
     #endif
8856
     #if ENABLED(E0_IS_TMC2130)
8938
     #if ENABLED(E0_IS_TMC2130)
8857
-      if (code_seen('E')) tmc2130_clear_otpw(stepperE0, 'E');
8939
+      if (clearE || clearAll) tmc2130_clear_otpw(stepperE0, 'E');
8858
     #endif
8940
     #endif
8859
   }
8941
   }
8860
 
8942
 
8943
+  /**
8944
+   * M913: Set HYBRID_THRESHOLD speed.
8945
+   */
8946
+  #if ENABLED(HYBRID_THRESHOLD)
8947
+    inline void gcode_M913() {
8948
+      uint16_t values[XYZE];
8949
+      LOOP_XYZE(i)
8950
+        values[i] = code_seen(axis_codes[i]) ? code_value_int() : 0;
8951
+
8952
+      #if ENABLED(X_IS_TMC2130)
8953
+        if (values[X_AXIS]) tmc2130_set_pwmthrs(stepperX, 'X', values[X_AXIS], planner.axis_steps_per_mm[X_AXIS]);
8954
+        else tmc2130_get_pwmthrs(stepperX, 'X', planner.axis_steps_per_mm[X_AXIS]);
8955
+      #endif
8956
+      #if ENABLED(Y_IS_TMC2130)
8957
+        if (values[Y_AXIS]) tmc2130_set_pwmthrs(stepperY, 'Y', values[Y_AXIS], planner.axis_steps_per_mm[Y_AXIS]);
8958
+        else tmc2130_get_pwmthrs(stepperY, 'Y', planner.axis_steps_per_mm[Y_AXIS]);
8959
+      #endif
8960
+      #if ENABLED(Z_IS_TMC2130)
8961
+        if (values[Z_AXIS]) tmc2130_set_pwmthrs(stepperZ, 'Z', values[Z_AXIS], planner.axis_steps_per_mm[Z_AXIS]);
8962
+        else tmc2130_get_pwmthrs(stepperZ, 'Z', planner.axis_steps_per_mm[Z_AXIS]);
8963
+      #endif
8964
+      #if ENABLED(E0_IS_TMC2130)
8965
+        if (values[E_AXIS]) tmc2130_set_pwmthrs(stepperE0, 'E', values[E_AXIS], planner.axis_steps_per_mm[E_AXIS]);
8966
+        else tmc2130_get_pwmthrs(stepperE0, 'E', planner.axis_steps_per_mm[E_AXIS]);
8967
+      #endif
8968
+    }
8969
+  #endif // HYBRID_THRESHOLD
8970
+
8971
+  /**
8972
+   * M914: Set SENSORLESS_HOMING sensitivity.
8973
+   */
8974
+  #if ENABLED(SENSORLESS_HOMING)
8975
+    inline void gcode_M914() {
8976
+      #if ENABLED(X_IS_TMC2130)
8977
+        if (code_seen(axis_codes[X_AXIS])) tmc2130_set_sgt(stepperX, 'X', code_value_int());
8978
+        else tmc2130_get_sgt(stepperX, 'X');
8979
+      #endif
8980
+      #if ENABLED(Y_IS_TMC2130)
8981
+        if (code_seen(axis_codes[Y_AXIS])) tmc2130_set_sgt(stepperY, 'Y', code_value_int());
8982
+        else tmc2130_get_sgt(stepperY, 'Y');
8983
+      #endif
8984
+    }
8985
+  #endif // SENSORLESS_HOMING
8986
+
8861
 #endif // HAVE_TMC2130
8987
 #endif // HAVE_TMC2130
8862
 
8988
 
8863
 /**
8989
 /**
8865
  */
8991
  */
8866
 inline void gcode_M907() {
8992
 inline void gcode_M907() {
8867
   #if HAS_DIGIPOTSS
8993
   #if HAS_DIGIPOTSS
8868
-    LOOP_XYZE(i)
8869
-    if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value_int());
8994
+    LOOP_XYZE(i) if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value_int());
8870
     if (code_seen('B')) stepper.digipot_current(4, code_value_int());
8995
     if (code_seen('B')) stepper.digipot_current(4, code_value_int());
8871
-    if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.digipot_current(i, code_value_int());
8996
+    if (code_seen('S')) for (uint8_t i = 0; i <= 4; i++) stepper.digipot_current(i, code_value_int());
8872
   #elif HAS_MOTOR_CURRENT_PWM
8997
   #elif HAS_MOTOR_CURRENT_PWM
8873
     #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
8998
     #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
8874
       if (code_seen('X')) stepper.digipot_current(0, code_value_int());
8999
       if (code_seen('X')) stepper.digipot_current(0, code_value_int());
8884
     // this one uses actual amps in floating point
9009
     // this one uses actual amps in floating point
8885
     LOOP_XYZE(i) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value_float());
9010
     LOOP_XYZE(i) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value_float());
8886
     // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...)
9011
     // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...)
8887
-    for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, code_value_float());
9012
+    for (uint8_t i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, code_value_float());
8888
   #endif
9013
   #endif
8889
   #if ENABLED(DAC_STEPPER_CURRENT)
9014
   #if ENABLED(DAC_STEPPER_CURRENT)
8890
     if (code_seen('S')) {
9015
     if (code_seen('S')) {
8891
-      float dac_percent = code_value_float();
9016
+      const float dac_percent = code_value_float();
8892
       for (uint8_t i = 0; i <= 4; i++) dac_current_percent(i, dac_percent);
9017
       for (uint8_t i = 0; i <= 4; i++) dac_current_percent(i, dac_percent);
8893
     }
9018
     }
8894
     LOOP_XYZE(i) if (code_seen(axis_codes[i])) dac_current_percent(i, code_value_float());
9019
     LOOP_XYZE(i) if (code_seen(axis_codes[i])) dac_current_percent(i, code_value_float());
10165
         case 912: // M911: Clear TMC2130 prewarn triggered flags
10290
         case 912: // M911: Clear TMC2130 prewarn triggered flags
10166
           gcode_M912();
10291
           gcode_M912();
10167
           break;
10292
           break;
10293
+
10294
+        #if ENABLED(HYBRID_THRESHOLD)
10295
+          case 913: // M913: Set HYBRID_THRESHOLD speed.
10296
+            gcode_M913();
10297
+            break;
10298
+        #endif
10299
+
10300
+        #if ENABLED(SENSORLESS_HOMING)
10301
+          case 914: // M914: Set SENSORLESS_HOMING sensitivity.
10302
+            gcode_M914();
10303
+            break;
10304
+        #endif
10168
       #endif
10305
       #endif
10169
 
10306
 
10170
       #if HAS_MICROSTEPS
10307
       #if HAS_MICROSTEPS
11390
   disable_e_steppers();
11527
   disable_e_steppers();
11391
 }
11528
 }
11392
 
11529
 
11393
-#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
11530
+#if ENABLED(HAVE_TMC2130)
11394
 
11531
 
11395
-  void automatic_current_control(const TMC2130Stepper &st) {
11396
-    #if CURRENT_STEP > 0
11397
-      const bool is_otpw = st.checkOT(), // Check otpw even if we don't adjust. Allows for flag inspection.
11398
-                 is_otpw_triggered = st.getOTPW();
11532
+  void automatic_current_control(TMC2130Stepper &st, String axisID) {
11533
+    // Check otpw even if we don't use automatic control. Allows for flag inspection.
11534
+    const bool is_otpw = st.checkOT();
11399
 
11535
 
11400
-      if (!is_otpw && !is_otpw_triggered) {
11401
-        // OTPW bit not triggered yet -> Increase current
11402
-        const uint16_t current = st.getCurrent() + CURRENT_STEP;
11403
-        if (current <= AUTO_ADJUST_MAX) st.SilentStepStick2130(current);
11536
+    // Report if a warning was triggered
11537
+    static bool previous_otpw = false;
11538
+    if (is_otpw && !previous_otpw) {
11539
+      char timestamp[10];
11540
+      duration_t elapsed = print_job_timer.duration();
11541
+      const bool has_days = (elapsed.value > 60*60*24L);
11542
+      (void)elapsed.toDigital(timestamp, has_days);
11543
+      SERIAL_ECHO(timestamp);
11544
+      SERIAL_ECHO(": ");
11545
+      SERIAL_ECHO(axisID);
11546
+      SERIAL_ECHOLNPGM(" driver overtemperature warning!");
11547
+    }
11548
+    previous_otpw = is_otpw;
11549
+
11550
+    #if CURRENT_STEP > 0 && ENABLED(AUTOMATIC_CURRENT_CONTROL)
11551
+      // Return if user has not enabled current control start with M906 S1.
11552
+      if (!auto_current_control) return;
11553
+
11554
+      /**
11555
+       * Decrease current if is_otpw is true.
11556
+       * Bail out if driver is disabled.
11557
+       * Increase current if OTPW has not been triggered yet.
11558
+       */
11559
+      uint16_t current = st.getCurrent();
11560
+      if (is_otpw) {
11561
+        st.setCurrent(current - CURRENT_STEP, R_SENSE, HOLD_MULTIPLIER);
11562
+        #if ENABLED(REPORT_CURRENT_CHANGE)
11563
+          SERIAL_ECHO(axisID);
11564
+          SERIAL_ECHOPAIR(" current decreased to ", st.getCurrent());
11565
+        #endif
11404
       }
11566
       }
11405
-      else if (is_otpw && is_otpw_triggered) {
11406
-        // OTPW bit triggered, triggered flag raised -> Decrease current
11407
-        st.SilentStepStick2130((float)st.getCurrent() - CURRENT_STEP);
11567
+
11568
+      else if (!st.isEnabled())
11569
+        return;
11570
+
11571
+      else if (!is_otpw && !st.getOTPW()) {
11572
+        current += CURRENT_STEP;
11573
+        if (current <= AUTO_ADJUST_MAX) {
11574
+          st.setCurrent(current, R_SENSE, HOLD_MULTIPLIER);
11575
+          #if ENABLED(REPORT_CURRENT_CHANGE)
11576
+            SERIAL_ECHO(axisID);
11577
+            SERIAL_ECHOPAIR(" current increased to ", st.getCurrent());
11578
+          #endif
11579
+        }
11408
       }
11580
       }
11409
-      // OTPW bit cleared (we've cooled down), triggered flag still raised until manually cleared -> Do nothing, we're good
11581
+      SERIAL_EOL;
11410
     #endif
11582
     #endif
11411
   }
11583
   }
11412
 
11584
 
11415
     if (ELAPSED(millis(), next_cOT)) {
11587
     if (ELAPSED(millis(), next_cOT)) {
11416
       next_cOT = millis() + 5000;
11588
       next_cOT = millis() + 5000;
11417
       #if ENABLED(X_IS_TMC2130)
11589
       #if ENABLED(X_IS_TMC2130)
11418
-        automatic_current_control(stepperX);
11590
+        automatic_current_control(stepperX, "X");
11419
       #endif
11591
       #endif
11420
       #if ENABLED(Y_IS_TMC2130)
11592
       #if ENABLED(Y_IS_TMC2130)
11421
-        automatic_current_control(stepperY);
11593
+        automatic_current_control(stepperY, "Y");
11422
       #endif
11594
       #endif
11423
       #if ENABLED(Z_IS_TMC2130)
11595
       #if ENABLED(Z_IS_TMC2130)
11424
-        automatic_current_control(stepperZ);
11596
+        automatic_current_control(stepperZ, "Z");
11425
       #endif
11597
       #endif
11426
       #if ENABLED(X2_IS_TMC2130)
11598
       #if ENABLED(X2_IS_TMC2130)
11427
-        automatic_current_control(stepperX2);
11599
+        automatic_current_control(stepperX2, "X2");
11428
       #endif
11600
       #endif
11429
       #if ENABLED(Y2_IS_TMC2130)
11601
       #if ENABLED(Y2_IS_TMC2130)
11430
-        automatic_current_control(stepperY2);
11602
+        automatic_current_control(stepperY2, "Y2");
11431
       #endif
11603
       #endif
11432
       #if ENABLED(Z2_IS_TMC2130)
11604
       #if ENABLED(Z2_IS_TMC2130)
11433
-        automatic_current_control(stepperZ2);
11605
+        automatic_current_control(stepperZ2, "Z2");
11434
       #endif
11606
       #endif
11435
       #if ENABLED(E0_IS_TMC2130)
11607
       #if ENABLED(E0_IS_TMC2130)
11436
-        automatic_current_control(stepperE0);
11608
+        automatic_current_control(stepperE0, "E0");
11437
       #endif
11609
       #endif
11438
       #if ENABLED(E1_IS_TMC2130)
11610
       #if ENABLED(E1_IS_TMC2130)
11439
-        automatic_current_control(stepperE1);
11611
+        automatic_current_control(stepperE1, "E1");
11440
       #endif
11612
       #endif
11441
       #if ENABLED(E2_IS_TMC2130)
11613
       #if ENABLED(E2_IS_TMC2130)
11442
-        automatic_current_control(stepperE2);
11614
+        automatic_current_control(stepperE2, "E2");
11443
       #endif
11615
       #endif
11444
       #if ENABLED(E3_IS_TMC2130)
11616
       #if ENABLED(E3_IS_TMC2130)
11445
-        automatic_current_control(stepperE3);
11617
+        automatic_current_control(stepperE3, "E3");
11618
+      #endif
11619
+      #if ENABLED(E4_IS_TMC2130)
11620
+        automatic_current_control(stepperE4, "E4");
11446
       #endif
11621
       #endif
11447
       #if ENABLED(E4_IS_TMC2130)
11622
       #if ENABLED(E4_IS_TMC2130)
11448
         automatic_current_control(stepperE4);
11623
         automatic_current_control(stepperE4);
11450
     }
11625
     }
11451
   }
11626
   }
11452
 
11627
 
11453
-#endif // AUTOMATIC_CURRENT_CONTROL
11628
+#endif // HAVE_TMC2130
11454
 
11629
 
11455
 /**
11630
 /**
11456
  * Manage several activities:
11631
  * Manage several activities:
11648
     handle_status_leds();
11823
     handle_status_leds();
11649
   #endif
11824
   #endif
11650
 
11825
 
11651
-  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
11826
+  #if ENABLED(HAVE_TMC2130)
11652
     checkOverTemp();
11827
     checkOverTemp();
11653
   #endif
11828
   #endif
11654
 
11829
 

+ 18
- 0
Marlin/SanityCheck.h View File

1091
   , "Please select no more than one LCD controller option."
1091
   , "Please select no more than one LCD controller option."
1092
 );
1092
 );
1093
 
1093
 
1094
+#if ENABLED(HAVE_TMC2130) && !( \
1095
+       ENABLED(  X_IS_TMC2130 ) \
1096
+    || ENABLED( X2_IS_TMC2130 ) \
1097
+    || ENABLED(  Y_IS_TMC2130 ) \
1098
+    || ENABLED( Y2_IS_TMC2130 ) \
1099
+    || ENABLED(  Z_IS_TMC2130 ) \
1100
+    || ENABLED( Z2_IS_TMC2130 ) \
1101
+    || ENABLED( E0_IS_TMC2130 ) \
1102
+    || ENABLED( E1_IS_TMC2130 ) \
1103
+    || ENABLED( E2_IS_TMC2130 ) \
1104
+    || ENABLED( E3_IS_TMC2130 ) )
1105
+  #error "Choose at least one TMC2130 stepper."
1106
+#endif
1107
+
1108
+#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
1109
+  #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
1110
+#endif
1111
+
1094
 /**
1112
 /**
1095
  * Require 4 or more elements in per-axis initializers
1113
  * Require 4 or more elements in per-axis initializers
1096
  */
1114
  */

+ 10
- 10
Marlin/configuration_store.cpp View File

1124
 
1124
 
1125
   #if ENABLED(HAVE_TMC2130)
1125
   #if ENABLED(HAVE_TMC2130)
1126
     #if ENABLED(X_IS_TMC2130)
1126
     #if ENABLED(X_IS_TMC2130)
1127
-      stepperX.setCurrent(X_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1127
+      stepperX.setCurrent(X_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1128
     #endif
1128
     #endif
1129
     #if ENABLED(Y_IS_TMC2130)
1129
     #if ENABLED(Y_IS_TMC2130)
1130
-      stepperY.setCurrent(Y_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1130
+      stepperY.setCurrent(Y_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1131
     #endif
1131
     #endif
1132
     #if ENABLED(Z_IS_TMC2130)
1132
     #if ENABLED(Z_IS_TMC2130)
1133
-      stepperZ.setCurrent(Z_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1133
+      stepperZ.setCurrent(Z_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1134
     #endif
1134
     #endif
1135
     #if ENABLED(X2_IS_TMC2130)
1135
     #if ENABLED(X2_IS_TMC2130)
1136
-      stepperX2.setCurrent(X2_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1136
+      stepperX2.setCurrent(X2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1137
     #endif
1137
     #endif
1138
     #if ENABLED(Y2_IS_TMC2130)
1138
     #if ENABLED(Y2_IS_TMC2130)
1139
-      stepperY2.setCurrent(Y2_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1139
+      stepperY2.setCurrent(Y2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1140
     #endif
1140
     #endif
1141
     #if ENABLED(Z2_IS_TMC2130)
1141
     #if ENABLED(Z2_IS_TMC2130)
1142
-      stepperZ2.setCurrent(Z2_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1142
+      stepperZ2.setCurrent(Z2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1143
     #endif
1143
     #endif
1144
     #if ENABLED(E0_IS_TMC2130)
1144
     #if ENABLED(E0_IS_TMC2130)
1145
-      stepperE0.setCurrent(E0_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1145
+      stepperE0.setCurrent(E0_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1146
     #endif
1146
     #endif
1147
     #if ENABLED(E1_IS_TMC2130)
1147
     #if ENABLED(E1_IS_TMC2130)
1148
-      stepperE1.setCurrent(E1_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1148
+      stepperE1.setCurrent(E1_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1149
     #endif
1149
     #endif
1150
     #if ENABLED(E2_IS_TMC2130)
1150
     #if ENABLED(E2_IS_TMC2130)
1151
-      stepperE2.setCurrent(E2_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1151
+      stepperE2.setCurrent(E2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1152
     #endif
1152
     #endif
1153
     #if ENABLED(E3_IS_TMC2130)
1153
     #if ENABLED(E3_IS_TMC2130)
1154
-      stepperE3.setCurrent(E3_MAX_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1154
+      stepperE3.setCurrent(E3_CURRENT, R_SENSE, HOLD_MULTIPLIER);
1155
     #endif
1155
     #endif
1156
   #endif
1156
   #endif
1157
 
1157
 

+ 1
- 1
Marlin/example_configurations/Cartesio/Configuration.h View File

1522
  * Enable support for an RGB LED connected to 5V digital pins, or
1522
  * Enable support for an RGB LED connected to 5V digital pins, or
1523
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1523
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1524
  *
1524
  *
1525
- * Adds the M150 command to set the LED (or LED strip) color. 
1525
+ * Adds the M150 command to set the LED (or LED strip) color.
1526
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1526
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1527
  * luminance values can be set from 0 to 255.
1527
  * luminance values can be set from 0 to 255.
1528
  *
1528
  *

+ 80
- 33
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

879
 //#define HAVE_TMC2130
879
 //#define HAVE_TMC2130
880
 
880
 
881
 #if ENABLED(HAVE_TMC2130)
881
 #if ENABLED(HAVE_TMC2130)
882
-  #define STEALTHCHOP
883
-
884
-  /**
885
-   * Let Marlin automatically control stepper current.
886
-   * This is still an experimental feature.
887
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
888
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
889
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
890
-   */
891
-  //#define AUTOMATIC_CURRENT_CONTROL
892
-  #define CURRENT_STEP          50  // [mA]
893
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
894
 
882
 
895
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
883
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   //#define X_IS_TMC2130
884
   //#define X_IS_TMC2130
913
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
901
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
902
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
 
903
 
916
-  #define X_MAX_CURRENT     1000  // rms current in mA
917
-  #define X_MICROSTEPS        16  // FULLSTEP..256
918
-  #define X_CHIP_SELECT       40  // Pin
904
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
905
+  #define X_MICROSTEPS        16  // 0..256
919
 
906
 
920
-  #define Y_MAX_CURRENT     1000
907
+  #define Y_CURRENT         1000
921
   #define Y_MICROSTEPS        16
908
   #define Y_MICROSTEPS        16
922
-  #define Y_CHIP_SELECT       42
923
 
909
 
924
-  #define Z_MAX_CURRENT     1000
910
+  #define Z_CURRENT         1000
925
   #define Z_MICROSTEPS        16
911
   #define Z_MICROSTEPS        16
926
-  #define Z_CHIP_SELECT       65
927
 
912
 
928
-  //#define X2_MAX_CURRENT  1000
913
+  //#define X2_CURRENT      1000
929
   //#define X2_MICROSTEPS     16
914
   //#define X2_MICROSTEPS     16
930
-  //#define X2_CHIP_SELECT    -1
931
 
915
 
932
-  //#define Y2_MAX_CURRENT  1000
916
+  //#define Y2_CURRENT      1000
933
   //#define Y2_MICROSTEPS     16
917
   //#define Y2_MICROSTEPS     16
934
-  //#define Y2_CHIP_SELECT    -1
935
 
918
 
936
-  //#define Z2_MAX_CURRENT  1000
919
+  //#define Z2_CURRENT      1000
937
   //#define Z2_MICROSTEPS     16
920
   //#define Z2_MICROSTEPS     16
938
-  //#define Z2_CHIP_SELECT    -1
939
 
921
 
940
-  //#define E0_MAX_CURRENT  1000
922
+  //#define E0_CURRENT      1000
941
   //#define E0_MICROSTEPS     16
923
   //#define E0_MICROSTEPS     16
942
-  //#define E0_CHIP_SELECT    -1
943
 
924
 
944
-  //#define E1_MAX_CURRENT  1000
925
+  //#define E1_CURRENT      1000
945
   //#define E1_MICROSTEPS     16
926
   //#define E1_MICROSTEPS     16
946
-  //#define E1_CHIP_SELECT    -1
947
 
927
 
948
-  //#define E2_MAX_CURRENT  1000
928
+  //#define E2_CURRENT      1000
949
   //#define E2_MICROSTEPS     16
929
   //#define E2_MICROSTEPS     16
950
-  //#define E2_CHIP_SELECT    -1
951
 
930
 
952
-  //#define E3_MAX_CURRENT  1000
931
+  //#define E3_CURRENT      1000
953
   //#define E3_MICROSTEPS     16
932
   //#define E3_MICROSTEPS     16
954
-  //#define E3_CHIP_SELECT    -1
933
+
934
+  //#define E4_CURRENT      1000
935
+  //#define E4_MICROSTEPS     16
936
+
937
+  /**
938
+   * Use Trinamic's ultra quiet stepping mode.
939
+   * When disabled, Marlin will use spreadCycle stepping mode.
940
+   */
941
+  #define STEALTHCHOP
942
+
943
+  /**
944
+   * Let Marlin automatically control stepper current.
945
+   * This is still an experimental feature.
946
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
947
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
948
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
949
+   * Relevant g-codes:
950
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
951
+   * M906 S1 - Start adjusting current
952
+   * M906 S0 - Stop adjusting current
953
+   * M911 - Report stepper driver overtemperature pre-warn condition.
954
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
955
+   */
956
+  //#define AUTOMATIC_CURRENT_CONTROL
957
+
958
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
959
+    #define CURRENT_STEP          50  // [mA]
960
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
961
+    #define REPORT_CURRENT_CHANGE
962
+  #endif
963
+
964
+  /**
965
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
966
+   * This mode allows for faster movements at the expense of higher noise levels.
967
+   * STEALTHCHOP needs to be enabled.
968
+   * M913 X/Y/Z/E to live tune the setting
969
+   */
970
+  //#define HYBRID_THRESHOLD
971
+
972
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
973
+  #define X2_HYBRID_THRESHOLD    100
974
+  #define Y_HYBRID_THRESHOLD     100
975
+  #define Y2_HYBRID_THRESHOLD    100
976
+  #define Z_HYBRID_THRESHOLD       4
977
+  #define Z2_HYBRID_THRESHOLD      4
978
+  #define E0_HYBRID_THRESHOLD     30
979
+  #define E1_HYBRID_THRESHOLD     30
980
+  #define E2_HYBRID_THRESHOLD     30
981
+  #define E3_HYBRID_THRESHOLD     30
982
+  #define E4_HYBRID_THRESHOLD     30
983
+
984
+  /**
985
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
986
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
987
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
988
+   *
989
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
990
+   * Higher values make the system LESS sensitive.
991
+   * Lower value make the system MORE sensitive.
992
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
993
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
994
+   * M914 X/Y to live tune the setting
995
+   */
996
+  //#define SENSORLESS_HOMING
997
+
998
+  #if ENABLED(SENSORLESS_HOMING)
999
+    #define X_HOMING_SENSITIVITY  19
1000
+    #define Y_HOMING_SENSITIVITY  19
1001
+  #endif
955
 
1002
 
956
   /**
1003
   /**
957
    * You can set your own advanced settings by filling in predefined functions.
1004
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/Felix/Configuration.h View File

1506
  * Enable support for an RGB LED connected to 5V digital pins, or
1506
  * Enable support for an RGB LED connected to 5V digital pins, or
1507
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1507
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1508
  *
1508
  *
1509
- * Adds the M150 command to set the LED (or LED strip) color. 
1509
+ * Adds the M150 command to set the LED (or LED strip) color.
1510
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1510
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1511
  * luminance values can be set from 0 to 255.
1511
  * luminance values can be set from 0 to 255.
1512
  *
1512
  *

+ 80
- 33
Marlin/example_configurations/Felix/Configuration_adv.h View File

879
 //#define HAVE_TMC2130
879
 //#define HAVE_TMC2130
880
 
880
 
881
 #if ENABLED(HAVE_TMC2130)
881
 #if ENABLED(HAVE_TMC2130)
882
-  #define STEALTHCHOP
883
-
884
-  /**
885
-   * Let Marlin automatically control stepper current.
886
-   * This is still an experimental feature.
887
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
888
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
889
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
890
-   */
891
-  //#define AUTOMATIC_CURRENT_CONTROL
892
-  #define CURRENT_STEP          50  // [mA]
893
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
894
 
882
 
895
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
883
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   //#define X_IS_TMC2130
884
   //#define X_IS_TMC2130
913
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
901
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
902
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
 
903
 
916
-  #define X_MAX_CURRENT     1000  // rms current in mA
917
-  #define X_MICROSTEPS        16  // FULLSTEP..256
918
-  #define X_CHIP_SELECT       40  // Pin
904
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
905
+  #define X_MICROSTEPS        16  // 0..256
919
 
906
 
920
-  #define Y_MAX_CURRENT     1000
907
+  #define Y_CURRENT         1000
921
   #define Y_MICROSTEPS        16
908
   #define Y_MICROSTEPS        16
922
-  #define Y_CHIP_SELECT       42
923
 
909
 
924
-  #define Z_MAX_CURRENT     1000
910
+  #define Z_CURRENT         1000
925
   #define Z_MICROSTEPS        16
911
   #define Z_MICROSTEPS        16
926
-  #define Z_CHIP_SELECT       65
927
 
912
 
928
-  //#define X2_MAX_CURRENT  1000
913
+  //#define X2_CURRENT      1000
929
   //#define X2_MICROSTEPS     16
914
   //#define X2_MICROSTEPS     16
930
-  //#define X2_CHIP_SELECT    -1
931
 
915
 
932
-  //#define Y2_MAX_CURRENT  1000
916
+  //#define Y2_CURRENT      1000
933
   //#define Y2_MICROSTEPS     16
917
   //#define Y2_MICROSTEPS     16
934
-  //#define Y2_CHIP_SELECT    -1
935
 
918
 
936
-  //#define Z2_MAX_CURRENT  1000
919
+  //#define Z2_CURRENT      1000
937
   //#define Z2_MICROSTEPS     16
920
   //#define Z2_MICROSTEPS     16
938
-  //#define Z2_CHIP_SELECT    -1
939
 
921
 
940
-  //#define E0_MAX_CURRENT  1000
922
+  //#define E0_CURRENT      1000
941
   //#define E0_MICROSTEPS     16
923
   //#define E0_MICROSTEPS     16
942
-  //#define E0_CHIP_SELECT    -1
943
 
924
 
944
-  //#define E1_MAX_CURRENT  1000
925
+  //#define E1_CURRENT      1000
945
   //#define E1_MICROSTEPS     16
926
   //#define E1_MICROSTEPS     16
946
-  //#define E1_CHIP_SELECT    -1
947
 
927
 
948
-  //#define E2_MAX_CURRENT  1000
928
+  //#define E2_CURRENT      1000
949
   //#define E2_MICROSTEPS     16
929
   //#define E2_MICROSTEPS     16
950
-  //#define E2_CHIP_SELECT    -1
951
 
930
 
952
-  //#define E3_MAX_CURRENT  1000
931
+  //#define E3_CURRENT      1000
953
   //#define E3_MICROSTEPS     16
932
   //#define E3_MICROSTEPS     16
954
-  //#define E3_CHIP_SELECT    -1
933
+
934
+  //#define E4_CURRENT      1000
935
+  //#define E4_MICROSTEPS     16
936
+
937
+  /**
938
+   * Use Trinamic's ultra quiet stepping mode.
939
+   * When disabled, Marlin will use spreadCycle stepping mode.
940
+   */
941
+  #define STEALTHCHOP
942
+
943
+  /**
944
+   * Let Marlin automatically control stepper current.
945
+   * This is still an experimental feature.
946
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
947
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
948
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
949
+   * Relevant g-codes:
950
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
951
+   * M906 S1 - Start adjusting current
952
+   * M906 S0 - Stop adjusting current
953
+   * M911 - Report stepper driver overtemperature pre-warn condition.
954
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
955
+   */
956
+  //#define AUTOMATIC_CURRENT_CONTROL
957
+
958
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
959
+    #define CURRENT_STEP          50  // [mA]
960
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
961
+    #define REPORT_CURRENT_CHANGE
962
+  #endif
963
+
964
+  /**
965
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
966
+   * This mode allows for faster movements at the expense of higher noise levels.
967
+   * STEALTHCHOP needs to be enabled.
968
+   * M913 X/Y/Z/E to live tune the setting
969
+   */
970
+  //#define HYBRID_THRESHOLD
971
+
972
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
973
+  #define X2_HYBRID_THRESHOLD    100
974
+  #define Y_HYBRID_THRESHOLD     100
975
+  #define Y2_HYBRID_THRESHOLD    100
976
+  #define Z_HYBRID_THRESHOLD       4
977
+  #define Z2_HYBRID_THRESHOLD      4
978
+  #define E0_HYBRID_THRESHOLD     30
979
+  #define E1_HYBRID_THRESHOLD     30
980
+  #define E2_HYBRID_THRESHOLD     30
981
+  #define E3_HYBRID_THRESHOLD     30
982
+  #define E4_HYBRID_THRESHOLD     30
983
+
984
+  /**
985
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
986
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
987
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
988
+   *
989
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
990
+   * Higher values make the system LESS sensitive.
991
+   * Lower value make the system MORE sensitive.
992
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
993
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
994
+   * M914 X/Y to live tune the setting
995
+   */
996
+  //#define SENSORLESS_HOMING
997
+
998
+  #if ENABLED(SENSORLESS_HOMING)
999
+    #define X_HOMING_SENSITIVITY  19
1000
+    #define Y_HOMING_SENSITIVITY  19
1001
+  #endif
955
 
1002
 
956
   /**
1003
   /**
957
    * You can set your own advanced settings by filling in predefined functions.
1004
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

1506
  * Enable support for an RGB LED connected to 5V digital pins, or
1506
  * Enable support for an RGB LED connected to 5V digital pins, or
1507
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1507
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1508
  *
1508
  *
1509
- * Adds the M150 command to set the LED (or LED strip) color. 
1509
+ * Adds the M150 command to set the LED (or LED strip) color.
1510
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1510
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1511
  * luminance values can be set from 0 to 255.
1511
  * luminance values can be set from 0 to 255.
1512
  *
1512
  *

+ 1
- 1
Marlin/example_configurations/Hephestos/Configuration.h View File

1514
  * Enable support for an RGB LED connected to 5V digital pins, or
1514
  * Enable support for an RGB LED connected to 5V digital pins, or
1515
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1515
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1516
  *
1516
  *
1517
- * Adds the M150 command to set the LED (or LED strip) color. 
1517
+ * Adds the M150 command to set the LED (or LED strip) color.
1518
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1518
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1519
  * luminance values can be set from 0 to 255.
1519
  * luminance values can be set from 0 to 255.
1520
  *
1520
  *

+ 80
- 33
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

879
 //#define HAVE_TMC2130
879
 //#define HAVE_TMC2130
880
 
880
 
881
 #if ENABLED(HAVE_TMC2130)
881
 #if ENABLED(HAVE_TMC2130)
882
-  #define STEALTHCHOP
883
-
884
-  /**
885
-   * Let Marlin automatically control stepper current.
886
-   * This is still an experimental feature.
887
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
888
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
889
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
890
-   */
891
-  //#define AUTOMATIC_CURRENT_CONTROL
892
-  #define CURRENT_STEP          50  // [mA]
893
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
894
 
882
 
895
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
883
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   //#define X_IS_TMC2130
884
   //#define X_IS_TMC2130
913
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
901
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
902
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
 
903
 
916
-  #define X_MAX_CURRENT     1000  // rms current in mA
917
-  #define X_MICROSTEPS        16  // FULLSTEP..256
918
-  #define X_CHIP_SELECT       40  // Pin
904
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
905
+  #define X_MICROSTEPS        16  // 0..256
919
 
906
 
920
-  #define Y_MAX_CURRENT     1000
907
+  #define Y_CURRENT         1000
921
   #define Y_MICROSTEPS        16
908
   #define Y_MICROSTEPS        16
922
-  #define Y_CHIP_SELECT       42
923
 
909
 
924
-  #define Z_MAX_CURRENT     1000
910
+  #define Z_CURRENT         1000
925
   #define Z_MICROSTEPS        16
911
   #define Z_MICROSTEPS        16
926
-  #define Z_CHIP_SELECT       65
927
 
912
 
928
-  //#define X2_MAX_CURRENT  1000
913
+  //#define X2_CURRENT      1000
929
   //#define X2_MICROSTEPS     16
914
   //#define X2_MICROSTEPS     16
930
-  //#define X2_CHIP_SELECT    -1
931
 
915
 
932
-  //#define Y2_MAX_CURRENT  1000
916
+  //#define Y2_CURRENT      1000
933
   //#define Y2_MICROSTEPS     16
917
   //#define Y2_MICROSTEPS     16
934
-  //#define Y2_CHIP_SELECT    -1
935
 
918
 
936
-  //#define Z2_MAX_CURRENT  1000
919
+  //#define Z2_CURRENT      1000
937
   //#define Z2_MICROSTEPS     16
920
   //#define Z2_MICROSTEPS     16
938
-  //#define Z2_CHIP_SELECT    -1
939
 
921
 
940
-  //#define E0_MAX_CURRENT  1000
922
+  //#define E0_CURRENT      1000
941
   //#define E0_MICROSTEPS     16
923
   //#define E0_MICROSTEPS     16
942
-  //#define E0_CHIP_SELECT    -1
943
 
924
 
944
-  //#define E1_MAX_CURRENT  1000
925
+  //#define E1_CURRENT      1000
945
   //#define E1_MICROSTEPS     16
926
   //#define E1_MICROSTEPS     16
946
-  //#define E1_CHIP_SELECT    -1
947
 
927
 
948
-  //#define E2_MAX_CURRENT  1000
928
+  //#define E2_CURRENT      1000
949
   //#define E2_MICROSTEPS     16
929
   //#define E2_MICROSTEPS     16
950
-  //#define E2_CHIP_SELECT    -1
951
 
930
 
952
-  //#define E3_MAX_CURRENT  1000
931
+  //#define E3_CURRENT      1000
953
   //#define E3_MICROSTEPS     16
932
   //#define E3_MICROSTEPS     16
954
-  //#define E3_CHIP_SELECT    -1
933
+
934
+  //#define E4_CURRENT      1000
935
+  //#define E4_MICROSTEPS     16
936
+
937
+  /**
938
+   * Use Trinamic's ultra quiet stepping mode.
939
+   * When disabled, Marlin will use spreadCycle stepping mode.
940
+   */
941
+  #define STEALTHCHOP
942
+
943
+  /**
944
+   * Let Marlin automatically control stepper current.
945
+   * This is still an experimental feature.
946
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
947
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
948
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
949
+   * Relevant g-codes:
950
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
951
+   * M906 S1 - Start adjusting current
952
+   * M906 S0 - Stop adjusting current
953
+   * M911 - Report stepper driver overtemperature pre-warn condition.
954
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
955
+   */
956
+  //#define AUTOMATIC_CURRENT_CONTROL
957
+
958
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
959
+    #define CURRENT_STEP          50  // [mA]
960
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
961
+    #define REPORT_CURRENT_CHANGE
962
+  #endif
963
+
964
+  /**
965
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
966
+   * This mode allows for faster movements at the expense of higher noise levels.
967
+   * STEALTHCHOP needs to be enabled.
968
+   * M913 X/Y/Z/E to live tune the setting
969
+   */
970
+  //#define HYBRID_THRESHOLD
971
+
972
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
973
+  #define X2_HYBRID_THRESHOLD    100
974
+  #define Y_HYBRID_THRESHOLD     100
975
+  #define Y2_HYBRID_THRESHOLD    100
976
+  #define Z_HYBRID_THRESHOLD       4
977
+  #define Z2_HYBRID_THRESHOLD      4
978
+  #define E0_HYBRID_THRESHOLD     30
979
+  #define E1_HYBRID_THRESHOLD     30
980
+  #define E2_HYBRID_THRESHOLD     30
981
+  #define E3_HYBRID_THRESHOLD     30
982
+  #define E4_HYBRID_THRESHOLD     30
983
+
984
+  /**
985
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
986
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
987
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
988
+   *
989
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
990
+   * Higher values make the system LESS sensitive.
991
+   * Lower value make the system MORE sensitive.
992
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
993
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
994
+   * M914 X/Y to live tune the setting
995
+   */
996
+  //#define SENSORLESS_HOMING
997
+
998
+  #if ENABLED(SENSORLESS_HOMING)
999
+    #define X_HOMING_SENSITIVITY  19
1000
+    #define Y_HOMING_SENSITIVITY  19
1001
+  #endif
955
 
1002
 
956
   /**
1003
   /**
957
    * You can set your own advanced settings by filling in predefined functions.
1004
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/Hephestos_2/Configuration.h View File

1517
  * Enable support for an RGB LED connected to 5V digital pins, or
1517
  * Enable support for an RGB LED connected to 5V digital pins, or
1518
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1518
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1519
  *
1519
  *
1520
- * Adds the M150 command to set the LED (or LED strip) color. 
1520
+ * Adds the M150 command to set the LED (or LED strip) color.
1521
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1521
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1522
  * luminance values can be set from 0 to 255.
1522
  * luminance values can be set from 0 to 255.
1523
  *
1523
  *

+ 80
- 33
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

863
 //#define HAVE_TMC2130
863
 //#define HAVE_TMC2130
864
 
864
 
865
 #if ENABLED(HAVE_TMC2130)
865
 #if ENABLED(HAVE_TMC2130)
866
-  #define STEALTHCHOP
867
-
868
-  /**
869
-   * Let Marlin automatically control stepper current.
870
-   * This is still an experimental feature.
871
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
872
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
873
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
874
-   */
875
-  //#define AUTOMATIC_CURRENT_CONTROL
876
-  #define CURRENT_STEP          50  // [mA]
877
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
878
 
866
 
879
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
867
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
880
   //#define X_IS_TMC2130
868
   //#define X_IS_TMC2130
897
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
885
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
898
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
886
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
899
 
887
 
900
-  #define X_MAX_CURRENT     1000  // rms current in mA
901
-  #define X_MICROSTEPS        16  // FULLSTEP..256
902
-  #define X_CHIP_SELECT       40  // Pin
888
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
889
+  #define X_MICROSTEPS        16  // 0..256
903
 
890
 
904
-  #define Y_MAX_CURRENT     1000
891
+  #define Y_CURRENT         1000
905
   #define Y_MICROSTEPS        16
892
   #define Y_MICROSTEPS        16
906
-  #define Y_CHIP_SELECT       42
907
 
893
 
908
-  #define Z_MAX_CURRENT     1000
894
+  #define Z_CURRENT         1000
909
   #define Z_MICROSTEPS        16
895
   #define Z_MICROSTEPS        16
910
-  #define Z_CHIP_SELECT       65
911
 
896
 
912
-  //#define X2_MAX_CURRENT  1000
897
+  //#define X2_CURRENT      1000
913
   //#define X2_MICROSTEPS     16
898
   //#define X2_MICROSTEPS     16
914
-  //#define X2_CHIP_SELECT    -1
915
 
899
 
916
-  //#define Y2_MAX_CURRENT  1000
900
+  //#define Y2_CURRENT      1000
917
   //#define Y2_MICROSTEPS     16
901
   //#define Y2_MICROSTEPS     16
918
-  //#define Y2_CHIP_SELECT    -1
919
 
902
 
920
-  //#define Z2_MAX_CURRENT  1000
903
+  //#define Z2_CURRENT      1000
921
   //#define Z2_MICROSTEPS     16
904
   //#define Z2_MICROSTEPS     16
922
-  //#define Z2_CHIP_SELECT    -1
923
 
905
 
924
-  //#define E0_MAX_CURRENT  1000
906
+  //#define E0_CURRENT      1000
925
   //#define E0_MICROSTEPS     16
907
   //#define E0_MICROSTEPS     16
926
-  //#define E0_CHIP_SELECT    -1
927
 
908
 
928
-  //#define E1_MAX_CURRENT  1000
909
+  //#define E1_CURRENT      1000
929
   //#define E1_MICROSTEPS     16
910
   //#define E1_MICROSTEPS     16
930
-  //#define E1_CHIP_SELECT    -1
931
 
911
 
932
-  //#define E2_MAX_CURRENT  1000
912
+  //#define E2_CURRENT      1000
933
   //#define E2_MICROSTEPS     16
913
   //#define E2_MICROSTEPS     16
934
-  //#define E2_CHIP_SELECT    -1
935
 
914
 
936
-  //#define E3_MAX_CURRENT  1000
915
+  //#define E3_CURRENT      1000
937
   //#define E3_MICROSTEPS     16
916
   //#define E3_MICROSTEPS     16
938
-  //#define E3_CHIP_SELECT    -1
917
+
918
+  //#define E3_CURRENT      1000
919
+  //#define E3_MICROSTEPS     16
920
+
921
+  /**
922
+   * Use Trinamic's ultra quiet stepping mode.
923
+   * When disabled, Marlin will use spreadCycle stepping mode.
924
+   */
925
+  #define STEALTHCHOP
926
+
927
+  /**
928
+   * Let Marlin automatically control stepper current.
929
+   * This is still an experimental feature.
930
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
931
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
932
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
933
+   * Relevant g-codes:
934
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
935
+   * M906 S1 - Start adjusting current
936
+   * M906 S0 - Stop adjusting current
937
+   * M911 - Report stepper driver overtemperature pre-warn condition.
938
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
939
+   */
940
+  //#define AUTOMATIC_CURRENT_CONTROL
941
+
942
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
943
+    #define CURRENT_STEP          50  // [mA]
944
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
945
+    #define REPORT_CURRENT_CHANGE
946
+  #endif
947
+
948
+  /**
949
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
950
+   * This mode allows for faster movements at the expense of higher noise levels.
951
+   * STEALTHCHOP needs to be enabled.
952
+   * M913 X/Y/Z/E to live tune the setting
953
+   */
954
+  //#define HYBRID_THRESHOLD
955
+
956
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
957
+  #define X2_HYBRID_THRESHOLD    100
958
+  #define Y_HYBRID_THRESHOLD     100
959
+  #define Y2_HYBRID_THRESHOLD    100
960
+  #define Z_HYBRID_THRESHOLD       4
961
+  #define Z2_HYBRID_THRESHOLD      4
962
+  #define E0_HYBRID_THRESHOLD     30
963
+  #define E1_HYBRID_THRESHOLD     30
964
+  #define E2_HYBRID_THRESHOLD     30
965
+  #define E3_HYBRID_THRESHOLD     30
966
+  #define E4_HYBRID_THRESHOLD     30
967
+
968
+  /**
969
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
970
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
971
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
972
+   *
973
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
974
+   * Higher values make the system LESS sensitive.
975
+   * Lower value make the system MORE sensitive.
976
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
977
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
978
+   * M914 X/Y to live tune the setting
979
+   */
980
+  //#define SENSORLESS_HOMING
981
+
982
+  #if ENABLED(SENSORLESS_HOMING)
983
+    #define X_HOMING_SENSITIVITY  19
984
+    #define Y_HOMING_SENSITIVITY  19
985
+  #endif
939
 
986
 
940
   /**
987
   /**
941
    * You can set your own advanced settings by filling in predefined functions.
988
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/K8200/Configuration.h View File

1557
  * Enable support for an RGB LED connected to 5V digital pins, or
1557
  * Enable support for an RGB LED connected to 5V digital pins, or
1558
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1558
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1559
  *
1559
  *
1560
- * Adds the M150 command to set the LED (or LED strip) color. 
1560
+ * Adds the M150 command to set the LED (or LED strip) color.
1561
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1561
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1562
  * luminance values can be set from 0 to 255.
1562
  * luminance values can be set from 0 to 255.
1563
  *
1563
  *

+ 80
- 33
Marlin/example_configurations/K8200/Configuration_adv.h View File

892
 //#define HAVE_TMC2130
892
 //#define HAVE_TMC2130
893
 
893
 
894
 #if ENABLED(HAVE_TMC2130)
894
 #if ENABLED(HAVE_TMC2130)
895
-  #define STEALTHCHOP
896
-
897
-  /**
898
-   * Let Marlin automatically control stepper current.
899
-   * This is still an experimental feature.
900
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
901
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
902
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
903
-   */
904
-  //#define AUTOMATIC_CURRENT_CONTROL
905
-  #define CURRENT_STEP          50  // [mA]
906
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
907
 
895
 
908
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
909
   //#define X_IS_TMC2130
897
   //#define X_IS_TMC2130
926
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
927
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
928
 
916
 
929
-  #define X_MAX_CURRENT     1000  // rms current in mA
930
-  #define X_MICROSTEPS        16  // FULLSTEP..256
931
-  #define X_CHIP_SELECT       40  // Pin
917
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
918
+  #define X_MICROSTEPS        16  // 0..256
932
 
919
 
933
-  #define Y_MAX_CURRENT     1000
920
+  #define Y_CURRENT         1000
934
   #define Y_MICROSTEPS        16
921
   #define Y_MICROSTEPS        16
935
-  #define Y_CHIP_SELECT       42
936
 
922
 
937
-  #define Z_MAX_CURRENT     1000
923
+  #define Z_CURRENT         1000
938
   #define Z_MICROSTEPS        16
924
   #define Z_MICROSTEPS        16
939
-  #define Z_CHIP_SELECT       65
940
 
925
 
941
-  //#define X2_MAX_CURRENT  1000
926
+  //#define X2_CURRENT      1000
942
   //#define X2_MICROSTEPS     16
927
   //#define X2_MICROSTEPS     16
943
-  //#define X2_CHIP_SELECT    -1
944
 
928
 
945
-  //#define Y2_MAX_CURRENT  1000
929
+  //#define Y2_CURRENT      1000
946
   //#define Y2_MICROSTEPS     16
930
   //#define Y2_MICROSTEPS     16
947
-  //#define Y2_CHIP_SELECT    -1
948
 
931
 
949
-  //#define Z2_MAX_CURRENT  1000
932
+  //#define Z2_CURRENT      1000
950
   //#define Z2_MICROSTEPS     16
933
   //#define Z2_MICROSTEPS     16
951
-  //#define Z2_CHIP_SELECT    -1
952
 
934
 
953
-  //#define E0_MAX_CURRENT  1000
935
+  //#define E0_CURRENT      1000
954
   //#define E0_MICROSTEPS     16
936
   //#define E0_MICROSTEPS     16
955
-  //#define E0_CHIP_SELECT    -1
956
 
937
 
957
-  //#define E1_MAX_CURRENT  1000
938
+  //#define E1_CURRENT      1000
958
   //#define E1_MICROSTEPS     16
939
   //#define E1_MICROSTEPS     16
959
-  //#define E1_CHIP_SELECT    -1
960
 
940
 
961
-  //#define E2_MAX_CURRENT  1000
941
+  //#define E2_CURRENT      1000
962
   //#define E2_MICROSTEPS     16
942
   //#define E2_MICROSTEPS     16
963
-  //#define E2_CHIP_SELECT    -1
964
 
943
 
965
-  //#define E3_MAX_CURRENT  1000
944
+  //#define E3_CURRENT      1000
966
   //#define E3_MICROSTEPS     16
945
   //#define E3_MICROSTEPS     16
967
-  //#define E3_CHIP_SELECT    -1
946
+
947
+  //#define E4_CURRENT      1000
948
+  //#define E4_MICROSTEPS     16
949
+
950
+  /**
951
+   * Use Trinamic's ultra quiet stepping mode.
952
+   * When disabled, Marlin will use spreadCycle stepping mode.
953
+   */
954
+  #define STEALTHCHOP
955
+
956
+  /**
957
+   * Let Marlin automatically control stepper current.
958
+   * This is still an experimental feature.
959
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
960
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
961
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
962
+   * Relevant g-codes:
963
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
964
+   * M906 S1 - Start adjusting current
965
+   * M906 S0 - Stop adjusting current
966
+   * M911 - Report stepper driver overtemperature pre-warn condition.
967
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
968
+   */
969
+  //#define AUTOMATIC_CURRENT_CONTROL
970
+
971
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
972
+    #define CURRENT_STEP          50  // [mA]
973
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
974
+    #define REPORT_CURRENT_CHANGE
975
+  #endif
976
+
977
+  /**
978
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
979
+   * This mode allows for faster movements at the expense of higher noise levels.
980
+   * STEALTHCHOP needs to be enabled.
981
+   * M913 X/Y/Z/E to live tune the setting
982
+   */
983
+  //#define HYBRID_THRESHOLD
984
+
985
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
986
+  #define X2_HYBRID_THRESHOLD    100
987
+  #define Y_HYBRID_THRESHOLD     100
988
+  #define Y2_HYBRID_THRESHOLD    100
989
+  #define Z_HYBRID_THRESHOLD       4
990
+  #define Z2_HYBRID_THRESHOLD      4
991
+  #define E0_HYBRID_THRESHOLD     30
992
+  #define E1_HYBRID_THRESHOLD     30
993
+  #define E2_HYBRID_THRESHOLD     30
994
+  #define E3_HYBRID_THRESHOLD     30
995
+  #define E4_HYBRID_THRESHOLD     30
996
+
997
+  /**
998
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
999
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
1000
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
1001
+   *
1002
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
1003
+   * Higher values make the system LESS sensitive.
1004
+   * Lower value make the system MORE sensitive.
1005
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
1006
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
1007
+   * M914 X/Y to live tune the setting
1008
+   */
1009
+  //#define SENSORLESS_HOMING
1010
+
1011
+  #if ENABLED(SENSORLESS_HOMING)
1012
+    #define X_HOMING_SENSITIVITY  19
1013
+    #define Y_HOMING_SENSITIVITY  19
1014
+  #endif
968
 
1015
 
969
   /**
1016
   /**
970
    * You can set your own advanced settings by filling in predefined functions.
1017
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/K8400/Configuration.h View File

1523
  * Enable support for an RGB LED connected to 5V digital pins, or
1523
  * Enable support for an RGB LED connected to 5V digital pins, or
1524
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1524
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1525
  *
1525
  *
1526
- * Adds the M150 command to set the LED (or LED strip) color. 
1526
+ * Adds the M150 command to set the LED (or LED strip) color.
1527
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1527
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1528
  * luminance values can be set from 0 to 255.
1528
  * luminance values can be set from 0 to 255.
1529
  *
1529
  *

+ 80
- 33
Marlin/example_configurations/K8400/Configuration_adv.h View File

879
 //#define HAVE_TMC2130
879
 //#define HAVE_TMC2130
880
 
880
 
881
 #if ENABLED(HAVE_TMC2130)
881
 #if ENABLED(HAVE_TMC2130)
882
-  #define STEALTHCHOP
883
-
884
-  /**
885
-   * Let Marlin automatically control stepper current.
886
-   * This is still an experimental feature.
887
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
888
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
889
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
890
-   */
891
-  //#define AUTOMATIC_CURRENT_CONTROL
892
-  #define CURRENT_STEP          50  // [mA]
893
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
894
 
882
 
895
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
883
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   //#define X_IS_TMC2130
884
   //#define X_IS_TMC2130
913
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
901
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
902
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
 
903
 
916
-  #define X_MAX_CURRENT     1000  // rms current in mA
917
-  #define X_MICROSTEPS        16  // FULLSTEP..256
918
-  #define X_CHIP_SELECT       40  // Pin
904
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
905
+  #define X_MICROSTEPS        16  // 0..256
919
 
906
 
920
-  #define Y_MAX_CURRENT     1000
907
+  #define Y_CURRENT         1000
921
   #define Y_MICROSTEPS        16
908
   #define Y_MICROSTEPS        16
922
-  #define Y_CHIP_SELECT       42
923
 
909
 
924
-  #define Z_MAX_CURRENT     1000
910
+  #define Z_CURRENT         1000
925
   #define Z_MICROSTEPS        16
911
   #define Z_MICROSTEPS        16
926
-  #define Z_CHIP_SELECT       65
927
 
912
 
928
-  //#define X2_MAX_CURRENT  1000
913
+  //#define X2_CURRENT      1000
929
   //#define X2_MICROSTEPS     16
914
   //#define X2_MICROSTEPS     16
930
-  //#define X2_CHIP_SELECT    -1
931
 
915
 
932
-  //#define Y2_MAX_CURRENT  1000
916
+  //#define Y2_CURRENT      1000
933
   //#define Y2_MICROSTEPS     16
917
   //#define Y2_MICROSTEPS     16
934
-  //#define Y2_CHIP_SELECT    -1
935
 
918
 
936
-  //#define Z2_MAX_CURRENT  1000
919
+  //#define Z2_CURRENT      1000
937
   //#define Z2_MICROSTEPS     16
920
   //#define Z2_MICROSTEPS     16
938
-  //#define Z2_CHIP_SELECT    -1
939
 
921
 
940
-  //#define E0_MAX_CURRENT  1000
922
+  //#define E0_CURRENT      1000
941
   //#define E0_MICROSTEPS     16
923
   //#define E0_MICROSTEPS     16
942
-  //#define E0_CHIP_SELECT    -1
943
 
924
 
944
-  //#define E1_MAX_CURRENT  1000
925
+  //#define E1_CURRENT      1000
945
   //#define E1_MICROSTEPS     16
926
   //#define E1_MICROSTEPS     16
946
-  //#define E1_CHIP_SELECT    -1
947
 
927
 
948
-  //#define E2_MAX_CURRENT  1000
928
+  //#define E2_CURRENT      1000
949
   //#define E2_MICROSTEPS     16
929
   //#define E2_MICROSTEPS     16
950
-  //#define E2_CHIP_SELECT    -1
951
 
930
 
952
-  //#define E3_MAX_CURRENT  1000
931
+  //#define E3_CURRENT      1000
953
   //#define E3_MICROSTEPS     16
932
   //#define E3_MICROSTEPS     16
954
-  //#define E3_CHIP_SELECT    -1
933
+
934
+  //#define E4_CURRENT      1000
935
+  //#define E4_MICROSTEPS     16
936
+
937
+  /**
938
+   * Use Trinamic's ultra quiet stepping mode.
939
+   * When disabled, Marlin will use spreadCycle stepping mode.
940
+   */
941
+  #define STEALTHCHOP
942
+
943
+  /**
944
+   * Let Marlin automatically control stepper current.
945
+   * This is still an experimental feature.
946
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
947
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
948
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
949
+   * Relevant g-codes:
950
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
951
+   * M906 S1 - Start adjusting current
952
+   * M906 S0 - Stop adjusting current
953
+   * M911 - Report stepper driver overtemperature pre-warn condition.
954
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
955
+   */
956
+  //#define AUTOMATIC_CURRENT_CONTROL
957
+
958
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
959
+    #define CURRENT_STEP          50  // [mA]
960
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
961
+    #define REPORT_CURRENT_CHANGE
962
+  #endif
963
+
964
+  /**
965
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
966
+   * This mode allows for faster movements at the expense of higher noise levels.
967
+   * STEALTHCHOP needs to be enabled.
968
+   * M913 X/Y/Z/E to live tune the setting
969
+   */
970
+  //#define HYBRID_THRESHOLD
971
+
972
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
973
+  #define X2_HYBRID_THRESHOLD    100
974
+  #define Y_HYBRID_THRESHOLD     100
975
+  #define Y2_HYBRID_THRESHOLD    100
976
+  #define Z_HYBRID_THRESHOLD       4
977
+  #define Z2_HYBRID_THRESHOLD      4
978
+  #define E0_HYBRID_THRESHOLD     30
979
+  #define E1_HYBRID_THRESHOLD     30
980
+  #define E2_HYBRID_THRESHOLD     30
981
+  #define E3_HYBRID_THRESHOLD     30
982
+  #define E4_HYBRID_THRESHOLD     30
983
+
984
+  /**
985
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
986
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
987
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
988
+   *
989
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
990
+   * Higher values make the system LESS sensitive.
991
+   * Lower value make the system MORE sensitive.
992
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
993
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
994
+   * M914 X/Y to live tune the setting
995
+   */
996
+  //#define SENSORLESS_HOMING
997
+
998
+  #if ENABLED(SENSORLESS_HOMING)
999
+    #define X_HOMING_SENSITIVITY  19
1000
+    #define Y_HOMING_SENSITIVITY  19
1001
+  #endif
955
 
1002
 
956
   /**
1003
   /**
957
    * You can set your own advanced settings by filling in predefined functions.
1004
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/K8400/Dual-head/Configuration.h View File

1523
  * Enable support for an RGB LED connected to 5V digital pins, or
1523
  * Enable support for an RGB LED connected to 5V digital pins, or
1524
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1524
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1525
  *
1525
  *
1526
- * Adds the M150 command to set the LED (or LED strip) color. 
1526
+ * Adds the M150 command to set the LED (or LED strip) color.
1527
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1527
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1528
  * luminance values can be set from 0 to 255.
1528
  * luminance values can be set from 0 to 255.
1529
  *
1529
  *

+ 1
- 1
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

1523
  * Enable support for an RGB LED connected to 5V digital pins, or
1523
  * Enable support for an RGB LED connected to 5V digital pins, or
1524
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1524
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1525
  *
1525
  *
1526
- * Adds the M150 command to set the LED (or LED strip) color. 
1526
+ * Adds the M150 command to set the LED (or LED strip) color.
1527
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1527
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1528
  * luminance values can be set from 0 to 255.
1528
  * luminance values can be set from 0 to 255.
1529
  *
1529
  *

+ 1
- 1
Marlin/example_configurations/RigidBot/Configuration.h View File

1524
  * Enable support for an RGB LED connected to 5V digital pins, or
1524
  * Enable support for an RGB LED connected to 5V digital pins, or
1525
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1525
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1526
  *
1526
  *
1527
- * Adds the M150 command to set the LED (or LED strip) color. 
1527
+ * Adds the M150 command to set the LED (or LED strip) color.
1528
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1528
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1529
  * luminance values can be set from 0 to 255.
1529
  * luminance values can be set from 0 to 255.
1530
  *
1530
  *

+ 80
- 33
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

879
 //#define HAVE_TMC2130
879
 //#define HAVE_TMC2130
880
 
880
 
881
 #if ENABLED(HAVE_TMC2130)
881
 #if ENABLED(HAVE_TMC2130)
882
-  #define STEALTHCHOP
883
-
884
-  /**
885
-   * Let Marlin automatically control stepper current.
886
-   * This is still an experimental feature.
887
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
888
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
889
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
890
-   */
891
-  //#define AUTOMATIC_CURRENT_CONTROL
892
-  #define CURRENT_STEP          50  // [mA]
893
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
894
 
882
 
895
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
883
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   //#define X_IS_TMC2130
884
   //#define X_IS_TMC2130
913
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
901
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
902
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
 
903
 
916
-  #define X_MAX_CURRENT     1000  // rms current in mA
917
-  #define X_MICROSTEPS        16  // FULLSTEP..256
918
-  #define X_CHIP_SELECT       40  // Pin
904
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
905
+  #define X_MICROSTEPS        16  // 0..256
919
 
906
 
920
-  #define Y_MAX_CURRENT     1000
907
+  #define Y_CURRENT         1000
921
   #define Y_MICROSTEPS        16
908
   #define Y_MICROSTEPS        16
922
-  #define Y_CHIP_SELECT       42
923
 
909
 
924
-  #define Z_MAX_CURRENT     1000
910
+  #define Z_CURRENT         1000
925
   #define Z_MICROSTEPS        16
911
   #define Z_MICROSTEPS        16
926
-  #define Z_CHIP_SELECT       65
927
 
912
 
928
-  //#define X2_MAX_CURRENT  1000
913
+  //#define X2_CURRENT      1000
929
   //#define X2_MICROSTEPS     16
914
   //#define X2_MICROSTEPS     16
930
-  //#define X2_CHIP_SELECT    -1
931
 
915
 
932
-  //#define Y2_MAX_CURRENT  1000
916
+  //#define Y2_CURRENT      1000
933
   //#define Y2_MICROSTEPS     16
917
   //#define Y2_MICROSTEPS     16
934
-  //#define Y2_CHIP_SELECT    -1
935
 
918
 
936
-  //#define Z2_MAX_CURRENT  1000
919
+  //#define Z2_CURRENT      1000
937
   //#define Z2_MICROSTEPS     16
920
   //#define Z2_MICROSTEPS     16
938
-  //#define Z2_CHIP_SELECT    -1
939
 
921
 
940
-  //#define E0_MAX_CURRENT  1000
922
+  //#define E0_CURRENT      1000
941
   //#define E0_MICROSTEPS     16
923
   //#define E0_MICROSTEPS     16
942
-  //#define E0_CHIP_SELECT    -1
943
 
924
 
944
-  //#define E1_MAX_CURRENT  1000
925
+  //#define E1_CURRENT      1000
945
   //#define E1_MICROSTEPS     16
926
   //#define E1_MICROSTEPS     16
946
-  //#define E1_CHIP_SELECT    -1
947
 
927
 
948
-  //#define E2_MAX_CURRENT  1000
928
+  //#define E2_CURRENT      1000
949
   //#define E2_MICROSTEPS     16
929
   //#define E2_MICROSTEPS     16
950
-  //#define E2_CHIP_SELECT    -1
951
 
930
 
952
-  //#define E3_MAX_CURRENT  1000
931
+  //#define E3_CURRENT      1000
953
   //#define E3_MICROSTEPS     16
932
   //#define E3_MICROSTEPS     16
954
-  //#define E3_CHIP_SELECT    -1
933
+
934
+  //#define E4_CURRENT      1000
935
+  //#define E4_MICROSTEPS     16
936
+
937
+  /**
938
+   * Use Trinamic's ultra quiet stepping mode.
939
+   * When disabled, Marlin will use spreadCycle stepping mode.
940
+   */
941
+  #define STEALTHCHOP
942
+
943
+  /**
944
+   * Let Marlin automatically control stepper current.
945
+   * This is still an experimental feature.
946
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
947
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
948
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
949
+   * Relevant g-codes:
950
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
951
+   * M906 S1 - Start adjusting current
952
+   * M906 S0 - Stop adjusting current
953
+   * M911 - Report stepper driver overtemperature pre-warn condition.
954
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
955
+   */
956
+  //#define AUTOMATIC_CURRENT_CONTROL
957
+
958
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
959
+    #define CURRENT_STEP          50  // [mA]
960
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
961
+    #define REPORT_CURRENT_CHANGE
962
+  #endif
963
+
964
+  /**
965
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
966
+   * This mode allows for faster movements at the expense of higher noise levels.
967
+   * STEALTHCHOP needs to be enabled.
968
+   * M913 X/Y/Z/E to live tune the setting
969
+   */
970
+  //#define HYBRID_THRESHOLD
971
+
972
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
973
+  #define X2_HYBRID_THRESHOLD    100
974
+  #define Y_HYBRID_THRESHOLD     100
975
+  #define Y2_HYBRID_THRESHOLD    100
976
+  #define Z_HYBRID_THRESHOLD       4
977
+  #define Z2_HYBRID_THRESHOLD      4
978
+  #define E0_HYBRID_THRESHOLD     30
979
+  #define E1_HYBRID_THRESHOLD     30
980
+  #define E2_HYBRID_THRESHOLD     30
981
+  #define E3_HYBRID_THRESHOLD     30
982
+  #define E4_HYBRID_THRESHOLD     30
983
+
984
+  /**
985
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
986
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
987
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
988
+   *
989
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
990
+   * Higher values make the system LESS sensitive.
991
+   * Lower value make the system MORE sensitive.
992
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
993
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
994
+   * M914 X/Y to live tune the setting
995
+   */
996
+  //#define SENSORLESS_HOMING
997
+
998
+  #if ENABLED(SENSORLESS_HOMING)
999
+    #define X_HOMING_SENSITIVITY  19
1000
+    #define Y_HOMING_SENSITIVITY  19
1001
+  #endif
955
 
1002
 
956
   /**
1003
   /**
957
    * You can set your own advanced settings by filling in predefined functions.
1004
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration.h View File

1538
  * Enable support for an RGB LED connected to 5V digital pins, or
1538
  * Enable support for an RGB LED connected to 5V digital pins, or
1539
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1539
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1540
  *
1540
  *
1541
- * Adds the M150 command to set the LED (or LED strip) color. 
1541
+ * Adds the M150 command to set the LED (or LED strip) color.
1542
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1542
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1543
  * luminance values can be set from 0 to 255.
1543
  * luminance values can be set from 0 to 255.
1544
  *
1544
  *

+ 80
- 33
Marlin/example_configurations/SCARA/Configuration_adv.h View File

879
 //#define HAVE_TMC2130
879
 //#define HAVE_TMC2130
880
 
880
 
881
 #if ENABLED(HAVE_TMC2130)
881
 #if ENABLED(HAVE_TMC2130)
882
-  #define STEALTHCHOP
883
-
884
-  /**
885
-   * Let Marlin automatically control stepper current.
886
-   * This is still an experimental feature.
887
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
888
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
889
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
890
-   */
891
-  //#define AUTOMATIC_CURRENT_CONTROL
892
-  #define CURRENT_STEP          50  // [mA]
893
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
894
 
882
 
895
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
883
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   //#define X_IS_TMC2130
884
   //#define X_IS_TMC2130
913
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
901
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
902
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
 
903
 
916
-  #define X_MAX_CURRENT     1000  // rms current in mA
917
-  #define X_MICROSTEPS        16  // FULLSTEP..256
918
-  #define X_CHIP_SELECT       40  // Pin
904
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
905
+  #define X_MICROSTEPS        16  // 0..256
919
 
906
 
920
-  #define Y_MAX_CURRENT     1000
907
+  #define Y_CURRENT         1000
921
   #define Y_MICROSTEPS        16
908
   #define Y_MICROSTEPS        16
922
-  #define Y_CHIP_SELECT       42
923
 
909
 
924
-  #define Z_MAX_CURRENT     1000
910
+  #define Z_CURRENT         1000
925
   #define Z_MICROSTEPS        16
911
   #define Z_MICROSTEPS        16
926
-  #define Z_CHIP_SELECT       65
927
 
912
 
928
-  //#define X2_MAX_CURRENT  1000
913
+  //#define X2_CURRENT      1000
929
   //#define X2_MICROSTEPS     16
914
   //#define X2_MICROSTEPS     16
930
-  //#define X2_CHIP_SELECT    -1
931
 
915
 
932
-  //#define Y2_MAX_CURRENT  1000
916
+  //#define Y2_CURRENT      1000
933
   //#define Y2_MICROSTEPS     16
917
   //#define Y2_MICROSTEPS     16
934
-  //#define Y2_CHIP_SELECT    -1
935
 
918
 
936
-  //#define Z2_MAX_CURRENT  1000
919
+  //#define Z2_CURRENT      1000
937
   //#define Z2_MICROSTEPS     16
920
   //#define Z2_MICROSTEPS     16
938
-  //#define Z2_CHIP_SELECT    -1
939
 
921
 
940
-  //#define E0_MAX_CURRENT  1000
922
+  //#define E0_CURRENT      1000
941
   //#define E0_MICROSTEPS     16
923
   //#define E0_MICROSTEPS     16
942
-  //#define E0_CHIP_SELECT    -1
943
 
924
 
944
-  //#define E1_MAX_CURRENT  1000
925
+  //#define E1_CURRENT      1000
945
   //#define E1_MICROSTEPS     16
926
   //#define E1_MICROSTEPS     16
946
-  //#define E1_CHIP_SELECT    -1
947
 
927
 
948
-  //#define E2_MAX_CURRENT  1000
928
+  //#define E2_CURRENT      1000
949
   //#define E2_MICROSTEPS     16
929
   //#define E2_MICROSTEPS     16
950
-  //#define E2_CHIP_SELECT    -1
951
 
930
 
952
-  //#define E3_MAX_CURRENT  1000
931
+  //#define E3_CURRENT      1000
953
   //#define E3_MICROSTEPS     16
932
   //#define E3_MICROSTEPS     16
954
-  //#define E3_CHIP_SELECT    -1
933
+
934
+  //#define E4_CURRENT      1000
935
+  //#define E4_MICROSTEPS     16
936
+
937
+  /**
938
+   * Use Trinamic's ultra quiet stepping mode.
939
+   * When disabled, Marlin will use spreadCycle stepping mode.
940
+   */
941
+  #define STEALTHCHOP
942
+
943
+  /**
944
+   * Let Marlin automatically control stepper current.
945
+   * This is still an experimental feature.
946
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
947
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
948
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
949
+   * Relevant g-codes:
950
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
951
+   * M906 S1 - Start adjusting current
952
+   * M906 S0 - Stop adjusting current
953
+   * M911 - Report stepper driver overtemperature pre-warn condition.
954
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
955
+   */
956
+  //#define AUTOMATIC_CURRENT_CONTROL
957
+
958
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
959
+    #define CURRENT_STEP          50  // [mA]
960
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
961
+    #define REPORT_CURRENT_CHANGE
962
+  #endif
963
+
964
+  /**
965
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
966
+   * This mode allows for faster movements at the expense of higher noise levels.
967
+   * STEALTHCHOP needs to be enabled.
968
+   * M913 X/Y/Z/E to live tune the setting
969
+   */
970
+  //#define HYBRID_THRESHOLD
971
+
972
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
973
+  #define X2_HYBRID_THRESHOLD    100
974
+  #define Y_HYBRID_THRESHOLD     100
975
+  #define Y2_HYBRID_THRESHOLD    100
976
+  #define Z_HYBRID_THRESHOLD       4
977
+  #define Z2_HYBRID_THRESHOLD      4
978
+  #define E0_HYBRID_THRESHOLD     30
979
+  #define E1_HYBRID_THRESHOLD     30
980
+  #define E2_HYBRID_THRESHOLD     30
981
+  #define E3_HYBRID_THRESHOLD     30
982
+  #define E4_HYBRID_THRESHOLD     30
983
+
984
+  /**
985
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
986
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
987
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
988
+   *
989
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
990
+   * Higher values make the system LESS sensitive.
991
+   * Lower value make the system MORE sensitive.
992
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
993
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
994
+   * M914 X/Y to live tune the setting
995
+   */
996
+  //#define SENSORLESS_HOMING
997
+
998
+  #if ENABLED(SENSORLESS_HOMING)
999
+    #define X_HOMING_SENSITIVITY  19
1000
+    #define Y_HOMING_SENSITIVITY  19
1001
+  #endif
955
 
1002
 
956
   /**
1003
   /**
957
    * You can set your own advanced settings by filling in predefined functions.
1004
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/TAZ4/Configuration.h View File

1543
  * Enable support for an RGB LED connected to 5V digital pins, or
1543
  * Enable support for an RGB LED connected to 5V digital pins, or
1544
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1544
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1545
  *
1545
  *
1546
- * Adds the M150 command to set the LED (or LED strip) color. 
1546
+ * Adds the M150 command to set the LED (or LED strip) color.
1547
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1547
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1548
  * luminance values can be set from 0 to 255.
1548
  * luminance values can be set from 0 to 255.
1549
  *
1549
  *

+ 80
- 33
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

887
 //#define HAVE_TMC2130
887
 //#define HAVE_TMC2130
888
 
888
 
889
 #if ENABLED(HAVE_TMC2130)
889
 #if ENABLED(HAVE_TMC2130)
890
-  #define STEALTHCHOP
891
-
892
-  /**
893
-   * Let Marlin automatically control stepper current.
894
-   * This is still an experimental feature.
895
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
896
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
897
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
898
-   */
899
-  //#define AUTOMATIC_CURRENT_CONTROL
900
-  #define CURRENT_STEP          50  // [mA]
901
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
902
 
890
 
903
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
891
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
904
   //#define X_IS_TMC2130
892
   //#define X_IS_TMC2130
921
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
909
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
922
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
910
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
923
 
911
 
924
-  #define X_MAX_CURRENT     1000  // rms current in mA
925
-  #define X_MICROSTEPS        16  // FULLSTEP..256
926
-  #define X_CHIP_SELECT       40  // Pin
912
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
913
+  #define X_MICROSTEPS        16  // 0..256
927
 
914
 
928
-  #define Y_MAX_CURRENT     1000
915
+  #define Y_CURRENT         1000
929
   #define Y_MICROSTEPS        16
916
   #define Y_MICROSTEPS        16
930
-  #define Y_CHIP_SELECT       42
931
 
917
 
932
-  #define Z_MAX_CURRENT     1000
918
+  #define Z_CURRENT         1000
933
   #define Z_MICROSTEPS        16
919
   #define Z_MICROSTEPS        16
934
-  #define Z_CHIP_SELECT       65
935
 
920
 
936
-  //#define X2_MAX_CURRENT  1000
921
+  //#define X2_CURRENT      1000
937
   //#define X2_MICROSTEPS     16
922
   //#define X2_MICROSTEPS     16
938
-  //#define X2_CHIP_SELECT    -1
939
 
923
 
940
-  //#define Y2_MAX_CURRENT  1000
924
+  //#define Y2_CURRENT      1000
941
   //#define Y2_MICROSTEPS     16
925
   //#define Y2_MICROSTEPS     16
942
-  //#define Y2_CHIP_SELECT    -1
943
 
926
 
944
-  //#define Z2_MAX_CURRENT  1000
927
+  //#define Z2_CURRENT      1000
945
   //#define Z2_MICROSTEPS     16
928
   //#define Z2_MICROSTEPS     16
946
-  //#define Z2_CHIP_SELECT    -1
947
 
929
 
948
-  //#define E0_MAX_CURRENT  1000
930
+  //#define E0_CURRENT      1000
949
   //#define E0_MICROSTEPS     16
931
   //#define E0_MICROSTEPS     16
950
-  //#define E0_CHIP_SELECT    -1
951
 
932
 
952
-  //#define E1_MAX_CURRENT  1000
933
+  //#define E1_CURRENT      1000
953
   //#define E1_MICROSTEPS     16
934
   //#define E1_MICROSTEPS     16
954
-  //#define E1_CHIP_SELECT    -1
955
 
935
 
956
-  //#define E2_MAX_CURRENT  1000
936
+  //#define E2_CURRENT      1000
957
   //#define E2_MICROSTEPS     16
937
   //#define E2_MICROSTEPS     16
958
-  //#define E2_CHIP_SELECT    -1
959
 
938
 
960
-  //#define E3_MAX_CURRENT  1000
939
+  //#define E3_CURRENT      1000
961
   //#define E3_MICROSTEPS     16
940
   //#define E3_MICROSTEPS     16
962
-  //#define E3_CHIP_SELECT    -1
941
+
942
+  //#define E4_CURRENT      1000
943
+  //#define E4_MICROSTEPS     16
944
+
945
+  /**
946
+   * Use Trinamic's ultra quiet stepping mode.
947
+   * When disabled, Marlin will use spreadCycle stepping mode.
948
+   */
949
+  #define STEALTHCHOP
950
+
951
+  /**
952
+   * Let Marlin automatically control stepper current.
953
+   * This is still an experimental feature.
954
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
955
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
956
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
957
+   * Relevant g-codes:
958
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
959
+   * M906 S1 - Start adjusting current
960
+   * M906 S0 - Stop adjusting current
961
+   * M911 - Report stepper driver overtemperature pre-warn condition.
962
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
963
+   */
964
+  //#define AUTOMATIC_CURRENT_CONTROL
965
+
966
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
967
+    #define CURRENT_STEP          50  // [mA]
968
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
969
+    #define REPORT_CURRENT_CHANGE
970
+  #endif
971
+
972
+  /**
973
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
974
+   * This mode allows for faster movements at the expense of higher noise levels.
975
+   * STEALTHCHOP needs to be enabled.
976
+   * M913 X/Y/Z/E to live tune the setting
977
+   */
978
+  //#define HYBRID_THRESHOLD
979
+
980
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
981
+  #define X2_HYBRID_THRESHOLD    100
982
+  #define Y_HYBRID_THRESHOLD     100
983
+  #define Y2_HYBRID_THRESHOLD    100
984
+  #define Z_HYBRID_THRESHOLD       4
985
+  #define Z2_HYBRID_THRESHOLD      4
986
+  #define E0_HYBRID_THRESHOLD     30
987
+  #define E1_HYBRID_THRESHOLD     30
988
+  #define E2_HYBRID_THRESHOLD     30
989
+  #define E3_HYBRID_THRESHOLD     30
990
+  #define E4_HYBRID_THRESHOLD     30
991
+
992
+  /**
993
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
994
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
995
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
996
+   *
997
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
998
+   * Higher values make the system LESS sensitive.
999
+   * Lower value make the system MORE sensitive.
1000
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
1001
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
1002
+   * M914 X/Y to live tune the setting
1003
+   */
1004
+  //#define SENSORLESS_HOMING
1005
+
1006
+  #if ENABLED(SENSORLESS_HOMING)
1007
+    #define X_HOMING_SENSITIVITY  19
1008
+    #define Y_HOMING_SENSITIVITY  19
1009
+  #endif
963
 
1010
 
964
   /**
1011
   /**
965
    * You can set your own advanced settings by filling in predefined functions.
1012
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/TinyBoy2/Configuration.h View File

1579
  * Enable support for an RGB LED connected to 5V digital pins, or
1579
  * Enable support for an RGB LED connected to 5V digital pins, or
1580
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1580
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1581
  *
1581
  *
1582
- * Adds the M150 command to set the LED (or LED strip) color. 
1582
+ * Adds the M150 command to set the LED (or LED strip) color.
1583
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1583
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1584
  * luminance values can be set from 0 to 255.
1584
  * luminance values can be set from 0 to 255.
1585
  *
1585
  *

+ 80
- 33
Marlin/example_configurations/TinyBoy2/Configuration_adv.h View File

882
 //#define HAVE_TMC2130
882
 //#define HAVE_TMC2130
883
 
883
 
884
 #if ENABLED(HAVE_TMC2130)
884
 #if ENABLED(HAVE_TMC2130)
885
-  #define STEALTHCHOP
886
-
887
-  /**
888
-   * Let Marlin automatically control stepper current.
889
-   * This is still an experimental feature.
890
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
891
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
892
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
893
-   */
894
-  //#define AUTOMATIC_CURRENT_CONTROL
895
-  #define CURRENT_STEP          50  // [mA]
896
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
897
 
885
 
898
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
886
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
899
   //#define X_IS_TMC2130
887
   //#define X_IS_TMC2130
916
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
904
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
917
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
905
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
918
 
906
 
919
-  #define X_MAX_CURRENT     1000  // rms current in mA
920
-  #define X_MICROSTEPS        16  // FULLSTEP..256
921
-  #define X_CHIP_SELECT       40  // Pin
907
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
908
+  #define X_MICROSTEPS        16  // 0..256
922
 
909
 
923
-  #define Y_MAX_CURRENT     1000
910
+  #define Y_CURRENT         1000
924
   #define Y_MICROSTEPS        16
911
   #define Y_MICROSTEPS        16
925
-  #define Y_CHIP_SELECT       42
926
 
912
 
927
-  #define Z_MAX_CURRENT     1000
913
+  #define Z_CURRENT         1000
928
   #define Z_MICROSTEPS        16
914
   #define Z_MICROSTEPS        16
929
-  #define Z_CHIP_SELECT       65
930
 
915
 
931
-  //#define X2_MAX_CURRENT  1000
916
+  //#define X2_CURRENT      1000
932
   //#define X2_MICROSTEPS     16
917
   //#define X2_MICROSTEPS     16
933
-  //#define X2_CHIP_SELECT    -1
934
 
918
 
935
-  //#define Y2_MAX_CURRENT  1000
919
+  //#define Y2_CURRENT      1000
936
   //#define Y2_MICROSTEPS     16
920
   //#define Y2_MICROSTEPS     16
937
-  //#define Y2_CHIP_SELECT    -1
938
 
921
 
939
-  //#define Z2_MAX_CURRENT  1000
922
+  //#define Z2_CURRENT      1000
940
   //#define Z2_MICROSTEPS     16
923
   //#define Z2_MICROSTEPS     16
941
-  //#define Z2_CHIP_SELECT    -1
942
 
924
 
943
-  //#define E0_MAX_CURRENT  1000
925
+  //#define E0_CURRENT      1000
944
   //#define E0_MICROSTEPS     16
926
   //#define E0_MICROSTEPS     16
945
-  //#define E0_CHIP_SELECT    -1
946
 
927
 
947
-  //#define E1_MAX_CURRENT  1000
928
+  //#define E1_CURRENT      1000
948
   //#define E1_MICROSTEPS     16
929
   //#define E1_MICROSTEPS     16
949
-  //#define E1_CHIP_SELECT    -1
950
 
930
 
951
-  //#define E2_MAX_CURRENT  1000
931
+  //#define E2_CURRENT      1000
952
   //#define E2_MICROSTEPS     16
932
   //#define E2_MICROSTEPS     16
953
-  //#define E2_CHIP_SELECT    -1
954
 
933
 
955
-  //#define E3_MAX_CURRENT  1000
934
+  //#define E3_CURRENT      1000
956
   //#define E3_MICROSTEPS     16
935
   //#define E3_MICROSTEPS     16
957
-  //#define E3_CHIP_SELECT    -1
936
+
937
+  //#define E4_CURRENT      1000
938
+  //#define E4_MICROSTEPS     16
939
+
940
+  /**
941
+   * Use Trinamic's ultra quiet stepping mode.
942
+   * When disabled, Marlin will use spreadCycle stepping mode.
943
+   */
944
+  #define STEALTHCHOP
945
+
946
+  /**
947
+   * Let Marlin automatically control stepper current.
948
+   * This is still an experimental feature.
949
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
950
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
951
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
952
+   * Relevant g-codes:
953
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
954
+   * M906 S1 - Start adjusting current
955
+   * M906 S0 - Stop adjusting current
956
+   * M911 - Report stepper driver overtemperature pre-warn condition.
957
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
958
+   */
959
+  //#define AUTOMATIC_CURRENT_CONTROL
960
+
961
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
962
+    #define CURRENT_STEP          50  // [mA]
963
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
964
+    #define REPORT_CURRENT_CHANGE
965
+  #endif
966
+
967
+  /**
968
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
969
+   * This mode allows for faster movements at the expense of higher noise levels.
970
+   * STEALTHCHOP needs to be enabled.
971
+   * M913 X/Y/Z/E to live tune the setting
972
+   */
973
+  //#define HYBRID_THRESHOLD
974
+
975
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
976
+  #define X2_HYBRID_THRESHOLD    100
977
+  #define Y_HYBRID_THRESHOLD     100
978
+  #define Y2_HYBRID_THRESHOLD    100
979
+  #define Z_HYBRID_THRESHOLD       4
980
+  #define Z2_HYBRID_THRESHOLD      4
981
+  #define E0_HYBRID_THRESHOLD     30
982
+  #define E1_HYBRID_THRESHOLD     30
983
+  #define E2_HYBRID_THRESHOLD     30
984
+  #define E3_HYBRID_THRESHOLD     30
985
+  #define E4_HYBRID_THRESHOLD     30
986
+
987
+  /**
988
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
989
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
990
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
991
+   *
992
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
993
+   * Higher values make the system LESS sensitive.
994
+   * Lower value make the system MORE sensitive.
995
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
996
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
997
+   * M914 X/Y to live tune the setting
998
+   */
999
+  //#define SENSORLESS_HOMING
1000
+
1001
+  #if ENABLED(SENSORLESS_HOMING)
1002
+    #define X_HOMING_SENSITIVITY  19
1003
+    #define Y_HOMING_SENSITIVITY  19
1004
+  #endif
958
 
1005
 
959
   /**
1006
   /**
960
    * You can set your own advanced settings by filling in predefined functions.
1007
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/WITBOX/Configuration.h View File

1514
  * Enable support for an RGB LED connected to 5V digital pins, or
1514
  * Enable support for an RGB LED connected to 5V digital pins, or
1515
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1515
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1516
  *
1516
  *
1517
- * Adds the M150 command to set the LED (or LED strip) color. 
1517
+ * Adds the M150 command to set the LED (or LED strip) color.
1518
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1518
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1519
  * luminance values can be set from 0 to 255.
1519
  * luminance values can be set from 0 to 255.
1520
  *
1520
  *

+ 80
- 33
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

879
 //#define HAVE_TMC2130
879
 //#define HAVE_TMC2130
880
 
880
 
881
 #if ENABLED(HAVE_TMC2130)
881
 #if ENABLED(HAVE_TMC2130)
882
-  #define STEALTHCHOP
883
-
884
-  /**
885
-   * Let Marlin automatically control stepper current.
886
-   * This is still an experimental feature.
887
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
888
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
889
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
890
-   */
891
-  //#define AUTOMATIC_CURRENT_CONTROL
892
-  #define CURRENT_STEP          50  // [mA]
893
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
894
 
882
 
895
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
883
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   //#define X_IS_TMC2130
884
   //#define X_IS_TMC2130
913
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
901
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
902
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
 
903
 
916
-  #define X_MAX_CURRENT     1000  // rms current in mA
917
-  #define X_MICROSTEPS        16  // FULLSTEP..256
918
-  #define X_CHIP_SELECT       40  // Pin
904
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
905
+  #define X_MICROSTEPS        16  // 0..256
919
 
906
 
920
-  #define Y_MAX_CURRENT     1000
907
+  #define Y_CURRENT         1000
921
   #define Y_MICROSTEPS        16
908
   #define Y_MICROSTEPS        16
922
-  #define Y_CHIP_SELECT       42
923
 
909
 
924
-  #define Z_MAX_CURRENT     1000
910
+  #define Z_CURRENT         1000
925
   #define Z_MICROSTEPS        16
911
   #define Z_MICROSTEPS        16
926
-  #define Z_CHIP_SELECT       65
927
 
912
 
928
-  //#define X2_MAX_CURRENT  1000
913
+  //#define X2_CURRENT      1000
929
   //#define X2_MICROSTEPS     16
914
   //#define X2_MICROSTEPS     16
930
-  //#define X2_CHIP_SELECT    -1
931
 
915
 
932
-  //#define Y2_MAX_CURRENT  1000
916
+  //#define Y2_CURRENT      1000
933
   //#define Y2_MICROSTEPS     16
917
   //#define Y2_MICROSTEPS     16
934
-  //#define Y2_CHIP_SELECT    -1
935
 
918
 
936
-  //#define Z2_MAX_CURRENT  1000
919
+  //#define Z2_CURRENT      1000
937
   //#define Z2_MICROSTEPS     16
920
   //#define Z2_MICROSTEPS     16
938
-  //#define Z2_CHIP_SELECT    -1
939
 
921
 
940
-  //#define E0_MAX_CURRENT  1000
922
+  //#define E0_CURRENT      1000
941
   //#define E0_MICROSTEPS     16
923
   //#define E0_MICROSTEPS     16
942
-  //#define E0_CHIP_SELECT    -1
943
 
924
 
944
-  //#define E1_MAX_CURRENT  1000
925
+  //#define E1_CURRENT      1000
945
   //#define E1_MICROSTEPS     16
926
   //#define E1_MICROSTEPS     16
946
-  //#define E1_CHIP_SELECT    -1
947
 
927
 
948
-  //#define E2_MAX_CURRENT  1000
928
+  //#define E2_CURRENT      1000
949
   //#define E2_MICROSTEPS     16
929
   //#define E2_MICROSTEPS     16
950
-  //#define E2_CHIP_SELECT    -1
951
 
930
 
952
-  //#define E3_MAX_CURRENT  1000
931
+  //#define E3_CURRENT      1000
953
   //#define E3_MICROSTEPS     16
932
   //#define E3_MICROSTEPS     16
954
-  //#define E3_CHIP_SELECT    -1
933
+
934
+  //#define E4_CURRENT      1000
935
+  //#define E4_MICROSTEPS     16
936
+
937
+  /**
938
+   * Use Trinamic's ultra quiet stepping mode.
939
+   * When disabled, Marlin will use spreadCycle stepping mode.
940
+   */
941
+  #define STEALTHCHOP
942
+
943
+  /**
944
+   * Let Marlin automatically control stepper current.
945
+   * This is still an experimental feature.
946
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
947
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
948
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
949
+   * Relevant g-codes:
950
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
951
+   * M906 S1 - Start adjusting current
952
+   * M906 S0 - Stop adjusting current
953
+   * M911 - Report stepper driver overtemperature pre-warn condition.
954
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
955
+   */
956
+  //#define AUTOMATIC_CURRENT_CONTROL
957
+
958
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
959
+    #define CURRENT_STEP          50  // [mA]
960
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
961
+    #define REPORT_CURRENT_CHANGE
962
+  #endif
963
+
964
+  /**
965
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
966
+   * This mode allows for faster movements at the expense of higher noise levels.
967
+   * STEALTHCHOP needs to be enabled.
968
+   * M913 X/Y/Z/E to live tune the setting
969
+   */
970
+  //#define HYBRID_THRESHOLD
971
+
972
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
973
+  #define X2_HYBRID_THRESHOLD    100
974
+  #define Y_HYBRID_THRESHOLD     100
975
+  #define Y2_HYBRID_THRESHOLD    100
976
+  #define Z_HYBRID_THRESHOLD       4
977
+  #define Z2_HYBRID_THRESHOLD      4
978
+  #define E0_HYBRID_THRESHOLD     30
979
+  #define E1_HYBRID_THRESHOLD     30
980
+  #define E2_HYBRID_THRESHOLD     30
981
+  #define E3_HYBRID_THRESHOLD     30
982
+  #define E4_HYBRID_THRESHOLD     30
983
+
984
+  /**
985
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
986
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
987
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
988
+   *
989
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
990
+   * Higher values make the system LESS sensitive.
991
+   * Lower value make the system MORE sensitive.
992
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
993
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
994
+   * M914 X/Y to live tune the setting
995
+   */
996
+  //#define SENSORLESS_HOMING
997
+
998
+  #if ENABLED(SENSORLESS_HOMING)
999
+    #define X_HOMING_SENSITIVITY  19
1000
+    #define Y_HOMING_SENSITIVITY  19
1001
+  #endif
955
 
1002
 
956
   /**
1003
   /**
957
    * You can set your own advanced settings by filling in predefined functions.
1004
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

1523
  * Enable support for an RGB LED connected to 5V digital pins, or
1523
  * Enable support for an RGB LED connected to 5V digital pins, or
1524
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1524
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1525
  *
1525
  *
1526
- * Adds the M150 command to set the LED (or LED strip) color. 
1526
+ * Adds the M150 command to set the LED (or LED strip) color.
1527
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1527
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1528
  * luminance values can be set from 0 to 255.
1528
  * luminance values can be set from 0 to 255.
1529
  *
1529
  *

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h View File

1645
  * Enable support for an RGB LED connected to 5V digital pins, or
1645
  * Enable support for an RGB LED connected to 5V digital pins, or
1646
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1646
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1647
  *
1647
  *
1648
- * Adds the M150 command to set the LED (or LED strip) color. 
1648
+ * Adds the M150 command to set the LED (or LED strip) color.
1649
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1649
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1650
  * luminance values can be set from 0 to 255.
1650
  * luminance values can be set from 0 to 255.
1651
  *
1651
  *

+ 85
- 34
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

327
   // Default x offset in duplication mode (typically set to half print bed width)
327
   // Default x offset in duplication mode (typically set to half print bed width)
328
   #define DEFAULT_DUPLICATION_X_OFFSET 100
328
   #define DEFAULT_DUPLICATION_X_OFFSET 100
329
 
329
 
330
-#endif //DUAL_X_CARRIAGE
330
+#endif // DUAL_X_CARRIAGE
331
+
332
+// Activate a solenoid on the active extruder with M380. Disable all with M381.
333
+// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid.
334
+//#define EXT_SOLENOID
331
 
335
 
332
 // @section homing
336
 // @section homing
333
 
337
 
899
 //#define HAVE_TMC2130
903
 //#define HAVE_TMC2130
900
 
904
 
901
 #if ENABLED(HAVE_TMC2130)
905
 #if ENABLED(HAVE_TMC2130)
902
-  #define STEALTHCHOP
903
-
904
-  /**
905
-   * Let Marlin automatically control stepper current.
906
-   * This is still an experimental feature.
907
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
908
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
909
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
910
-   */
911
-  //#define AUTOMATIC_CURRENT_CONTROL
912
-  #define CURRENT_STEP          50  // [mA]
913
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
914
 
906
 
915
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
907
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
916
   //#define X_IS_TMC2130
908
   //#define X_IS_TMC2130
933
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
925
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
934
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
926
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
935
 
927
 
936
-  #define X_MAX_CURRENT     1000  // rms current in mA
937
-  #define X_MICROSTEPS        16  // FULLSTEP..256
938
-  #define X_CHIP_SELECT       40  // Pin
928
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
929
+  #define X_MICROSTEPS        16  // 0..256
939
 
930
 
940
-  #define Y_MAX_CURRENT     1000
931
+  #define Y_CURRENT         1000
941
   #define Y_MICROSTEPS        16
932
   #define Y_MICROSTEPS        16
942
-  #define Y_CHIP_SELECT       42
943
 
933
 
944
-  #define Z_MAX_CURRENT     1000
934
+  #define Z_CURRENT         1000
945
   #define Z_MICROSTEPS        16
935
   #define Z_MICROSTEPS        16
946
-  #define Z_CHIP_SELECT       65
947
 
936
 
948
-  //#define X2_MAX_CURRENT  1000
937
+  //#define X2_CURRENT      1000
949
   //#define X2_MICROSTEPS     16
938
   //#define X2_MICROSTEPS     16
950
-  //#define X2_CHIP_SELECT    -1
951
 
939
 
952
-  //#define Y2_MAX_CURRENT  1000
940
+  //#define Y2_CURRENT      1000
953
   //#define Y2_MICROSTEPS     16
941
   //#define Y2_MICROSTEPS     16
954
-  //#define Y2_CHIP_SELECT    -1
955
 
942
 
956
-  //#define Z2_MAX_CURRENT  1000
943
+  //#define Z2_CURRENT      1000
957
   //#define Z2_MICROSTEPS     16
944
   //#define Z2_MICROSTEPS     16
958
-  //#define Z2_CHIP_SELECT    -1
959
 
945
 
960
-  //#define E0_MAX_CURRENT  1000
946
+  //#define E0_CURRENT      1000
961
   //#define E0_MICROSTEPS     16
947
   //#define E0_MICROSTEPS     16
962
-  //#define E0_CHIP_SELECT    -1
963
 
948
 
964
-  //#define E1_MAX_CURRENT  1000
949
+  //#define E1_CURRENT      1000
965
   //#define E1_MICROSTEPS     16
950
   //#define E1_MICROSTEPS     16
966
-  //#define E1_CHIP_SELECT    -1
967
 
951
 
968
-  //#define E2_MAX_CURRENT  1000
952
+  //#define E2_CURRENT      1000
969
   //#define E2_MICROSTEPS     16
953
   //#define E2_MICROSTEPS     16
970
-  //#define E2_CHIP_SELECT    -1
971
 
954
 
972
-  //#define E3_MAX_CURRENT  1000
955
+  //#define E3_CURRENT      1000
973
   //#define E3_MICROSTEPS     16
956
   //#define E3_MICROSTEPS     16
974
-  //#define E3_CHIP_SELECT    -1
957
+
958
+  //#define E4_CURRENT      1000
959
+  //#define E4_MICROSTEPS     16
960
+
961
+  /**
962
+   * Use Trinamic's ultra quiet stepping mode.
963
+   * When disabled, Marlin will use spreadCycle stepping mode.
964
+   */
965
+  #define STEALTHCHOP
966
+
967
+  /**
968
+   * Let Marlin automatically control stepper current.
969
+   * This is still an experimental feature.
970
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
971
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
972
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
973
+   * Relevant g-codes:
974
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
975
+   * M906 S1 - Start adjusting current
976
+   * M906 S0 - Stop adjusting current
977
+   * M911 - Report stepper driver overtemperature pre-warn condition.
978
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
979
+   */
980
+  //#define AUTOMATIC_CURRENT_CONTROL
981
+
982
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
983
+    #define CURRENT_STEP          50  // [mA]
984
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
985
+    #define REPORT_CURRENT_CHANGE
986
+  #endif
987
+
988
+  /**
989
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
990
+   * This mode allows for faster movements at the expense of higher noise levels.
991
+   * STEALTHCHOP needs to be enabled.
992
+   * M913 X/Y/Z/E to live tune the setting
993
+   */
994
+  //#define HYBRID_THRESHOLD
995
+
996
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
997
+  #define X2_HYBRID_THRESHOLD    100
998
+  #define Y_HYBRID_THRESHOLD     100
999
+  #define Y2_HYBRID_THRESHOLD    100
1000
+  #define Z_HYBRID_THRESHOLD       4
1001
+  #define Z2_HYBRID_THRESHOLD      4
1002
+  #define E0_HYBRID_THRESHOLD     30
1003
+  #define E1_HYBRID_THRESHOLD     30
1004
+  #define E2_HYBRID_THRESHOLD     30
1005
+  #define E3_HYBRID_THRESHOLD     30
1006
+  #define E4_HYBRID_THRESHOLD     30
1007
+
1008
+  /**
1009
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
1010
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
1011
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
1012
+   *
1013
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
1014
+   * Higher values make the system LESS sensitive.
1015
+   * Lower value make the system MORE sensitive.
1016
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
1017
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
1018
+   * M914 X/Y to live tune the setting
1019
+   */
1020
+  //#define SENSORLESS_HOMING
1021
+
1022
+  #if ENABLED(SENSORLESS_HOMING)
1023
+    #define X_HOMING_SENSITIVITY  19
1024
+    #define Y_HOMING_SENSITIVITY  19
1025
+  #endif
975
 
1026
 
976
   /**
1027
   /**
977
    * You can set your own advanced settings by filling in predefined functions.
1028
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h View File

1647
  * Enable support for an RGB LED connected to 5V digital pins, or
1647
  * Enable support for an RGB LED connected to 5V digital pins, or
1648
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1648
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1649
  *
1649
  *
1650
- * Adds the M150 command to set the LED (or LED strip) color. 
1650
+ * Adds the M150 command to set the LED (or LED strip) color.
1651
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1651
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1652
  * luminance values can be set from 0 to 255.
1652
  * luminance values can be set from 0 to 255.
1653
  *
1653
  *

+ 80
- 33
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h View File

902
 //#define HAVE_TMC2130
902
 //#define HAVE_TMC2130
903
 
903
 
904
 #if ENABLED(HAVE_TMC2130)
904
 #if ENABLED(HAVE_TMC2130)
905
-  #define STEALTHCHOP
906
-
907
-  /**
908
-   * Let Marlin automatically control stepper current.
909
-   * This is still an experimental feature.
910
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
911
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
912
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
913
-   */
914
-  //#define AUTOMATIC_CURRENT_CONTROL
915
-  #define CURRENT_STEP          50  // [mA]
916
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
917
 
905
 
918
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
906
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
919
   //#define X_IS_TMC2130
907
   //#define X_IS_TMC2130
936
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
924
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
937
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
925
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
938
 
926
 
939
-  #define X_MAX_CURRENT     1000  // rms current in mA
940
-  #define X_MICROSTEPS        16  // FULLSTEP..256
941
-  #define X_CHIP_SELECT       40  // Pin
927
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
928
+  #define X_MICROSTEPS        16  // 0..256
942
 
929
 
943
-  #define Y_MAX_CURRENT     1000
930
+  #define Y_CURRENT         1000
944
   #define Y_MICROSTEPS        16
931
   #define Y_MICROSTEPS        16
945
-  #define Y_CHIP_SELECT       42
946
 
932
 
947
-  #define Z_MAX_CURRENT     1000
933
+  #define Z_CURRENT         1000
948
   #define Z_MICROSTEPS        16
934
   #define Z_MICROSTEPS        16
949
-  #define Z_CHIP_SELECT       65
950
 
935
 
951
-  //#define X2_MAX_CURRENT  1000
936
+  //#define X2_CURRENT      1000
952
   //#define X2_MICROSTEPS     16
937
   //#define X2_MICROSTEPS     16
953
-  //#define X2_CHIP_SELECT    -1
954
 
938
 
955
-  //#define Y2_MAX_CURRENT  1000
939
+  //#define Y2_CURRENT      1000
956
   //#define Y2_MICROSTEPS     16
940
   //#define Y2_MICROSTEPS     16
957
-  //#define Y2_CHIP_SELECT    -1
958
 
941
 
959
-  //#define Z2_MAX_CURRENT  1000
942
+  //#define Z2_CURRENT      1000
960
   //#define Z2_MICROSTEPS     16
943
   //#define Z2_MICROSTEPS     16
961
-  //#define Z2_CHIP_SELECT    -1
962
 
944
 
963
-  //#define E0_MAX_CURRENT  1000
945
+  //#define E0_CURRENT      1000
964
   //#define E0_MICROSTEPS     16
946
   //#define E0_MICROSTEPS     16
965
-  //#define E0_CHIP_SELECT    -1
966
 
947
 
967
-  //#define E1_MAX_CURRENT  1000
948
+  //#define E1_CURRENT      1000
968
   //#define E1_MICROSTEPS     16
949
   //#define E1_MICROSTEPS     16
969
-  //#define E1_CHIP_SELECT    -1
970
 
950
 
971
-  //#define E2_MAX_CURRENT  1000
951
+  //#define E2_CURRENT      1000
972
   //#define E2_MICROSTEPS     16
952
   //#define E2_MICROSTEPS     16
973
-  //#define E2_CHIP_SELECT    -1
974
 
953
 
975
-  //#define E3_MAX_CURRENT  1000
954
+  //#define E3_CURRENT      1000
976
   //#define E3_MICROSTEPS     16
955
   //#define E3_MICROSTEPS     16
977
-  //#define E3_CHIP_SELECT    -1
956
+
957
+  //#define E4_CURRENT      1000
958
+  //#define E4_MICROSTEPS     16
959
+
960
+  /**
961
+   * Use Trinamic's ultra quiet stepping mode.
962
+   * When disabled, Marlin will use spreadCycle stepping mode.
963
+   */
964
+  #define STEALTHCHOP
965
+
966
+  /**
967
+   * Let Marlin automatically control stepper current.
968
+   * This is still an experimental feature.
969
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
970
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
971
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
972
+   * Relevant g-codes:
973
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
974
+   * M906 S1 - Start adjusting current
975
+   * M906 S0 - Stop adjusting current
976
+   * M911 - Report stepper driver overtemperature pre-warn condition.
977
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
978
+   */
979
+  //#define AUTOMATIC_CURRENT_CONTROL
980
+
981
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
982
+    #define CURRENT_STEP          50  // [mA]
983
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
984
+    #define REPORT_CURRENT_CHANGE
985
+  #endif
986
+
987
+  /**
988
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
989
+   * This mode allows for faster movements at the expense of higher noise levels.
990
+   * STEALTHCHOP needs to be enabled.
991
+   * M913 X/Y/Z/E to live tune the setting
992
+   */
993
+  //#define HYBRID_THRESHOLD
994
+
995
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
996
+  #define X2_HYBRID_THRESHOLD    100
997
+  #define Y_HYBRID_THRESHOLD     100
998
+  #define Y2_HYBRID_THRESHOLD    100
999
+  #define Z_HYBRID_THRESHOLD       4
1000
+  #define Z2_HYBRID_THRESHOLD      4
1001
+  #define E0_HYBRID_THRESHOLD     30
1002
+  #define E1_HYBRID_THRESHOLD     30
1003
+  #define E2_HYBRID_THRESHOLD     30
1004
+  #define E3_HYBRID_THRESHOLD     30
1005
+  #define E4_HYBRID_THRESHOLD     30
1006
+
1007
+  /**
1008
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
1009
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
1010
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
1011
+   *
1012
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
1013
+   * Higher values make the system LESS sensitive.
1014
+   * Lower value make the system MORE sensitive.
1015
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
1016
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
1017
+   * M914 X/Y to live tune the setting
1018
+   */
1019
+  //#define SENSORLESS_HOMING
1020
+
1021
+  #if ENABLED(SENSORLESS_HOMING)
1022
+    #define X_HOMING_SENSITIVITY  19
1023
+    #define Y_HOMING_SENSITIVITY  19
1024
+  #endif
978
 
1025
 
979
   /**
1026
   /**
980
    * You can set your own advanced settings by filling in predefined functions.
1027
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h View File

1635
  * Enable support for an RGB LED connected to 5V digital pins, or
1635
  * Enable support for an RGB LED connected to 5V digital pins, or
1636
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1636
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1637
  *
1637
  *
1638
- * Adds the M150 command to set the LED (or LED strip) color. 
1638
+ * Adds the M150 command to set the LED (or LED strip) color.
1639
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1639
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1640
  * luminance values can be set from 0 to 255.
1640
  * luminance values can be set from 0 to 255.
1641
  *
1641
  *

+ 80
- 33
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

900
 //#define HAVE_TMC2130
900
 //#define HAVE_TMC2130
901
 
901
 
902
 #if ENABLED(HAVE_TMC2130)
902
 #if ENABLED(HAVE_TMC2130)
903
-  #define STEALTHCHOP
904
-
905
-  /**
906
-   * Let Marlin automatically control stepper current.
907
-   * This is still an experimental feature.
908
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
909
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
910
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
911
-   */
912
-  //#define AUTOMATIC_CURRENT_CONTROL
913
-  #define CURRENT_STEP          50  // [mA]
914
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
915
 
903
 
916
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
904
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
917
   //#define X_IS_TMC2130
905
   //#define X_IS_TMC2130
934
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
922
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
935
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
923
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
936
 
924
 
937
-  #define X_MAX_CURRENT     1000  // rms current in mA
938
-  #define X_MICROSTEPS        16  // FULLSTEP..256
939
-  #define X_CHIP_SELECT       40  // Pin
925
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
926
+  #define X_MICROSTEPS        16  // 0..256
940
 
927
 
941
-  #define Y_MAX_CURRENT     1000
928
+  #define Y_CURRENT         1000
942
   #define Y_MICROSTEPS        16
929
   #define Y_MICROSTEPS        16
943
-  #define Y_CHIP_SELECT       42
944
 
930
 
945
-  #define Z_MAX_CURRENT     1000
931
+  #define Z_CURRENT         1000
946
   #define Z_MICROSTEPS        16
932
   #define Z_MICROSTEPS        16
947
-  #define Z_CHIP_SELECT       65
948
 
933
 
949
-  //#define X2_MAX_CURRENT  1000
934
+  //#define X2_CURRENT      1000
950
   //#define X2_MICROSTEPS     16
935
   //#define X2_MICROSTEPS     16
951
-  //#define X2_CHIP_SELECT    -1
952
 
936
 
953
-  //#define Y2_MAX_CURRENT  1000
937
+  //#define Y2_CURRENT      1000
954
   //#define Y2_MICROSTEPS     16
938
   //#define Y2_MICROSTEPS     16
955
-  //#define Y2_CHIP_SELECT    -1
956
 
939
 
957
-  //#define Z2_MAX_CURRENT  1000
940
+  //#define Z2_CURRENT      1000
958
   //#define Z2_MICROSTEPS     16
941
   //#define Z2_MICROSTEPS     16
959
-  //#define Z2_CHIP_SELECT    -1
960
 
942
 
961
-  //#define E0_MAX_CURRENT  1000
943
+  //#define E0_CURRENT      1000
962
   //#define E0_MICROSTEPS     16
944
   //#define E0_MICROSTEPS     16
963
-  //#define E0_CHIP_SELECT    -1
964
 
945
 
965
-  //#define E1_MAX_CURRENT  1000
946
+  //#define E1_CURRENT      1000
966
   //#define E1_MICROSTEPS     16
947
   //#define E1_MICROSTEPS     16
967
-  //#define E1_CHIP_SELECT    -1
968
 
948
 
969
-  //#define E2_MAX_CURRENT  1000
949
+  //#define E2_CURRENT      1000
970
   //#define E2_MICROSTEPS     16
950
   //#define E2_MICROSTEPS     16
971
-  //#define E2_CHIP_SELECT    -1
972
 
951
 
973
-  //#define E3_MAX_CURRENT  1000
952
+  //#define E3_CURRENT      1000
974
   //#define E3_MICROSTEPS     16
953
   //#define E3_MICROSTEPS     16
975
-  //#define E3_CHIP_SELECT    -1
954
+
955
+  //#define E4_CURRENT      1000
956
+  //#define E4_MICROSTEPS     16
957
+
958
+  /**
959
+   * Use Trinamic's ultra quiet stepping mode.
960
+   * When disabled, Marlin will use spreadCycle stepping mode.
961
+   */
962
+  #define STEALTHCHOP
963
+
964
+  /**
965
+   * Let Marlin automatically control stepper current.
966
+   * This is still an experimental feature.
967
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
968
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
969
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
970
+   * Relevant g-codes:
971
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
972
+   * M906 S1 - Start adjusting current
973
+   * M906 S0 - Stop adjusting current
974
+   * M911 - Report stepper driver overtemperature pre-warn condition.
975
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
976
+   */
977
+  //#define AUTOMATIC_CURRENT_CONTROL
978
+
979
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
980
+    #define CURRENT_STEP          50  // [mA]
981
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
982
+    #define REPORT_CURRENT_CHANGE
983
+  #endif
984
+
985
+  /**
986
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
987
+   * This mode allows for faster movements at the expense of higher noise levels.
988
+   * STEALTHCHOP needs to be enabled.
989
+   * M913 X/Y/Z/E to live tune the setting
990
+   */
991
+  //#define HYBRID_THRESHOLD
992
+
993
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
994
+  #define X2_HYBRID_THRESHOLD    100
995
+  #define Y_HYBRID_THRESHOLD     100
996
+  #define Y2_HYBRID_THRESHOLD    100
997
+  #define Z_HYBRID_THRESHOLD       4
998
+  #define Z2_HYBRID_THRESHOLD      4
999
+  #define E0_HYBRID_THRESHOLD     30
1000
+  #define E1_HYBRID_THRESHOLD     30
1001
+  #define E2_HYBRID_THRESHOLD     30
1002
+  #define E3_HYBRID_THRESHOLD     30
1003
+  #define E4_HYBRID_THRESHOLD     30
1004
+
1005
+  /**
1006
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
1007
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
1008
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
1009
+   *
1010
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
1011
+   * Higher values make the system LESS sensitive.
1012
+   * Lower value make the system MORE sensitive.
1013
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
1014
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
1015
+   * M914 X/Y to live tune the setting
1016
+   */
1017
+  //#define SENSORLESS_HOMING
1018
+
1019
+  #if ENABLED(SENSORLESS_HOMING)
1020
+    #define X_HOMING_SENSITIVITY  19
1021
+    #define Y_HOMING_SENSITIVITY  19
1022
+  #endif
976
 
1023
 
977
   /**
1024
   /**
978
    * You can set your own advanced settings by filling in predefined functions.
1025
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

1631
  * Enable support for an RGB LED connected to 5V digital pins, or
1631
  * Enable support for an RGB LED connected to 5V digital pins, or
1632
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1632
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1633
  *
1633
  *
1634
- * Adds the M150 command to set the LED (or LED strip) color. 
1634
+ * Adds the M150 command to set the LED (or LED strip) color.
1635
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1635
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1636
  * luminance values can be set from 0 to 255.
1636
  * luminance values can be set from 0 to 255.
1637
  *
1637
  *

+ 80
- 33
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

900
 //#define HAVE_TMC2130
900
 //#define HAVE_TMC2130
901
 
901
 
902
 #if ENABLED(HAVE_TMC2130)
902
 #if ENABLED(HAVE_TMC2130)
903
-  #define STEALTHCHOP
904
-
905
-  /**
906
-   * Let Marlin automatically control stepper current.
907
-   * This is still an experimental feature.
908
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
909
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
910
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
911
-   */
912
-  //#define AUTOMATIC_CURRENT_CONTROL
913
-  #define CURRENT_STEP          50  // [mA]
914
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
915
 
903
 
916
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
904
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
917
   //#define X_IS_TMC2130
905
   //#define X_IS_TMC2130
934
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
922
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
935
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
923
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
936
 
924
 
937
-  #define X_MAX_CURRENT     1000  // rms current in mA
938
-  #define X_MICROSTEPS        16  // FULLSTEP..256
939
-  #define X_CHIP_SELECT       40  // Pin
925
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
926
+  #define X_MICROSTEPS        16  // 0..256
940
 
927
 
941
-  #define Y_MAX_CURRENT     1000
928
+  #define Y_CURRENT         1000
942
   #define Y_MICROSTEPS        16
929
   #define Y_MICROSTEPS        16
943
-  #define Y_CHIP_SELECT       42
944
 
930
 
945
-  #define Z_MAX_CURRENT     1000
931
+  #define Z_CURRENT         1000
946
   #define Z_MICROSTEPS        16
932
   #define Z_MICROSTEPS        16
947
-  #define Z_CHIP_SELECT       65
948
 
933
 
949
-  //#define X2_MAX_CURRENT  1000
934
+  //#define X2_CURRENT      1000
950
   //#define X2_MICROSTEPS     16
935
   //#define X2_MICROSTEPS     16
951
-  //#define X2_CHIP_SELECT    -1
952
 
936
 
953
-  //#define Y2_MAX_CURRENT  1000
937
+  //#define Y2_CURRENT      1000
954
   //#define Y2_MICROSTEPS     16
938
   //#define Y2_MICROSTEPS     16
955
-  //#define Y2_CHIP_SELECT    -1
956
 
939
 
957
-  //#define Z2_MAX_CURRENT  1000
940
+  //#define Z2_CURRENT      1000
958
   //#define Z2_MICROSTEPS     16
941
   //#define Z2_MICROSTEPS     16
959
-  //#define Z2_CHIP_SELECT    -1
960
 
942
 
961
-  //#define E0_MAX_CURRENT  1000
943
+  //#define E0_CURRENT      1000
962
   //#define E0_MICROSTEPS     16
944
   //#define E0_MICROSTEPS     16
963
-  //#define E0_CHIP_SELECT    -1
964
 
945
 
965
-  //#define E1_MAX_CURRENT  1000
946
+  //#define E1_CURRENT      1000
966
   //#define E1_MICROSTEPS     16
947
   //#define E1_MICROSTEPS     16
967
-  //#define E1_CHIP_SELECT    -1
968
 
948
 
969
-  //#define E2_MAX_CURRENT  1000
949
+  //#define E2_CURRENT      1000
970
   //#define E2_MICROSTEPS     16
950
   //#define E2_MICROSTEPS     16
971
-  //#define E2_CHIP_SELECT    -1
972
 
951
 
973
-  //#define E3_MAX_CURRENT  1000
952
+  //#define E3_CURRENT      1000
974
   //#define E3_MICROSTEPS     16
953
   //#define E3_MICROSTEPS     16
975
-  //#define E3_CHIP_SELECT    -1
954
+
955
+  //#define E4_CURRENT      1000
956
+  //#define E4_MICROSTEPS     16
957
+
958
+  /**
959
+   * Use Trinamic's ultra quiet stepping mode.
960
+   * When disabled, Marlin will use spreadCycle stepping mode.
961
+   */
962
+  #define STEALTHCHOP
963
+
964
+  /**
965
+   * Let Marlin automatically control stepper current.
966
+   * This is still an experimental feature.
967
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
968
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
969
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
970
+   * Relevant g-codes:
971
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
972
+   * M906 S1 - Start adjusting current
973
+   * M906 S0 - Stop adjusting current
974
+   * M911 - Report stepper driver overtemperature pre-warn condition.
975
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
976
+   */
977
+  //#define AUTOMATIC_CURRENT_CONTROL
978
+
979
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
980
+    #define CURRENT_STEP          50  // [mA]
981
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
982
+    #define REPORT_CURRENT_CHANGE
983
+  #endif
984
+
985
+  /**
986
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
987
+   * This mode allows for faster movements at the expense of higher noise levels.
988
+   * STEALTHCHOP needs to be enabled.
989
+   * M913 X/Y/Z/E to live tune the setting
990
+   */
991
+  //#define HYBRID_THRESHOLD
992
+
993
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
994
+  #define X2_HYBRID_THRESHOLD    100
995
+  #define Y_HYBRID_THRESHOLD     100
996
+  #define Y2_HYBRID_THRESHOLD    100
997
+  #define Z_HYBRID_THRESHOLD       4
998
+  #define Z2_HYBRID_THRESHOLD      4
999
+  #define E0_HYBRID_THRESHOLD     30
1000
+  #define E1_HYBRID_THRESHOLD     30
1001
+  #define E2_HYBRID_THRESHOLD     30
1002
+  #define E3_HYBRID_THRESHOLD     30
1003
+  #define E4_HYBRID_THRESHOLD     30
1004
+
1005
+  /**
1006
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
1007
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
1008
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
1009
+   *
1010
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
1011
+   * Higher values make the system LESS sensitive.
1012
+   * Lower value make the system MORE sensitive.
1013
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
1014
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
1015
+   * M914 X/Y to live tune the setting
1016
+   */
1017
+  //#define SENSORLESS_HOMING
1018
+
1019
+  #if ENABLED(SENSORLESS_HOMING)
1020
+    #define X_HOMING_SENSITIVITY  19
1021
+    #define Y_HOMING_SENSITIVITY  19
1022
+  #endif
976
 
1023
 
977
   /**
1024
   /**
978
    * You can set your own advanced settings by filling in predefined functions.
1025
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

1639
  * Enable support for an RGB LED connected to 5V digital pins, or
1639
  * Enable support for an RGB LED connected to 5V digital pins, or
1640
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1640
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1641
  *
1641
  *
1642
- * Adds the M150 command to set the LED (or LED strip) color. 
1642
+ * Adds the M150 command to set the LED (or LED strip) color.
1643
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1643
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1644
  * luminance values can be set from 0 to 255.
1644
  * luminance values can be set from 0 to 255.
1645
  *
1645
  *

+ 80
- 33
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

906
 //#define HAVE_TMC2130
906
 //#define HAVE_TMC2130
907
 
907
 
908
 #if ENABLED(HAVE_TMC2130)
908
 #if ENABLED(HAVE_TMC2130)
909
-  #define STEALTHCHOP
910
-
911
-  /**
912
-   * Let Marlin automatically control stepper current.
913
-   * This is still an experimental feature.
914
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
915
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
916
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
917
-   */
918
-  //#define AUTOMATIC_CURRENT_CONTROL
919
-  #define CURRENT_STEP          50  // [mA]
920
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
921
 
909
 
922
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
910
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
923
   //#define X_IS_TMC2130
911
   //#define X_IS_TMC2130
940
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
928
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
941
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
929
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
942
 
930
 
943
-  #define X_MAX_CURRENT     1000  // rms current in mA
944
-  #define X_MICROSTEPS        16  // FULLSTEP..256
945
-  #define X_CHIP_SELECT       40  // Pin
931
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
932
+  #define X_MICROSTEPS        16  // 0..256
946
 
933
 
947
-  #define Y_MAX_CURRENT     1000
934
+  #define Y_CURRENT         1000
948
   #define Y_MICROSTEPS        16
935
   #define Y_MICROSTEPS        16
949
-  #define Y_CHIP_SELECT       42
950
 
936
 
951
-  #define Z_MAX_CURRENT     1000
937
+  #define Z_CURRENT         1000
952
   #define Z_MICROSTEPS        16
938
   #define Z_MICROSTEPS        16
953
-  #define Z_CHIP_SELECT       65
954
 
939
 
955
-  //#define X2_MAX_CURRENT  1000
940
+  //#define X2_CURRENT      1000
956
   //#define X2_MICROSTEPS     16
941
   //#define X2_MICROSTEPS     16
957
-  //#define X2_CHIP_SELECT    -1
958
 
942
 
959
-  //#define Y2_MAX_CURRENT  1000
943
+  //#define Y2_CURRENT      1000
960
   //#define Y2_MICROSTEPS     16
944
   //#define Y2_MICROSTEPS     16
961
-  //#define Y2_CHIP_SELECT    -1
962
 
945
 
963
-  //#define Z2_MAX_CURRENT  1000
946
+  //#define Z2_CURRENT      1000
964
   //#define Z2_MICROSTEPS     16
947
   //#define Z2_MICROSTEPS     16
965
-  //#define Z2_CHIP_SELECT    -1
966
 
948
 
967
-  //#define E0_MAX_CURRENT  1000
949
+  //#define E0_CURRENT      1000
968
   //#define E0_MICROSTEPS     16
950
   //#define E0_MICROSTEPS     16
969
-  //#define E0_CHIP_SELECT    -1
970
 
951
 
971
-  //#define E1_MAX_CURRENT  1000
952
+  //#define E1_CURRENT      1000
972
   //#define E1_MICROSTEPS     16
953
   //#define E1_MICROSTEPS     16
973
-  //#define E1_CHIP_SELECT    -1
974
 
954
 
975
-  //#define E2_MAX_CURRENT  1000
955
+  //#define E2_CURRENT      1000
976
   //#define E2_MICROSTEPS     16
956
   //#define E2_MICROSTEPS     16
977
-  //#define E2_CHIP_SELECT    -1
978
 
957
 
979
-  //#define E3_MAX_CURRENT  1000
958
+  //#define E3_CURRENT      1000
980
   //#define E3_MICROSTEPS     16
959
   //#define E3_MICROSTEPS     16
981
-  //#define E3_CHIP_SELECT    -1
960
+
961
+  //#define E4_CURRENT      1000
962
+  //#define E4_MICROSTEPS     16
963
+
964
+  /**
965
+   * Use Trinamic's ultra quiet stepping mode.
966
+   * When disabled, Marlin will use spreadCycle stepping mode.
967
+   */
968
+  #define STEALTHCHOP
969
+
970
+  /**
971
+   * Let Marlin automatically control stepper current.
972
+   * This is still an experimental feature.
973
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
974
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
975
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
976
+   * Relevant g-codes:
977
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
978
+   * M906 S1 - Start adjusting current
979
+   * M906 S0 - Stop adjusting current
980
+   * M911 - Report stepper driver overtemperature pre-warn condition.
981
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
982
+   */
983
+  //#define AUTOMATIC_CURRENT_CONTROL
984
+
985
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
986
+    #define CURRENT_STEP          50  // [mA]
987
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
988
+    #define REPORT_CURRENT_CHANGE
989
+  #endif
990
+
991
+  /**
992
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
993
+   * This mode allows for faster movements at the expense of higher noise levels.
994
+   * STEALTHCHOP needs to be enabled.
995
+   * M913 X/Y/Z/E to live tune the setting
996
+   */
997
+  //#define HYBRID_THRESHOLD
998
+
999
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
1000
+  #define X2_HYBRID_THRESHOLD    100
1001
+  #define Y_HYBRID_THRESHOLD     100
1002
+  #define Y2_HYBRID_THRESHOLD    100
1003
+  #define Z_HYBRID_THRESHOLD       4
1004
+  #define Z2_HYBRID_THRESHOLD      4
1005
+  #define E0_HYBRID_THRESHOLD     30
1006
+  #define E1_HYBRID_THRESHOLD     30
1007
+  #define E2_HYBRID_THRESHOLD     30
1008
+  #define E3_HYBRID_THRESHOLD     30
1009
+  #define E4_HYBRID_THRESHOLD     30
1010
+
1011
+  /**
1012
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
1013
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
1014
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
1015
+   *
1016
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
1017
+   * Higher values make the system LESS sensitive.
1018
+   * Lower value make the system MORE sensitive.
1019
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
1020
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
1021
+   * M914 X/Y to live tune the setting
1022
+   */
1023
+  //#define SENSORLESS_HOMING
1024
+
1025
+  #if ENABLED(SENSORLESS_HOMING)
1026
+    #define X_HOMING_SENSITIVITY  19
1027
+    #define Y_HOMING_SENSITIVITY  19
1028
+  #endif
982
 
1029
 
983
   /**
1030
   /**
984
    * You can set your own advanced settings by filling in predefined functions.
1031
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

1646
  * Enable support for an RGB LED connected to 5V digital pins, or
1646
  * Enable support for an RGB LED connected to 5V digital pins, or
1647
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1647
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1648
  *
1648
  *
1649
- * Adds the M150 command to set the LED (or LED strip) color. 
1649
+ * Adds the M150 command to set the LED (or LED strip) color.
1650
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1650
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1651
  * luminance values can be set from 0 to 255.
1651
  * luminance values can be set from 0 to 255.
1652
  *
1652
  *

+ 80
- 33
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

900
 //#define HAVE_TMC2130
900
 //#define HAVE_TMC2130
901
 
901
 
902
 #if ENABLED(HAVE_TMC2130)
902
 #if ENABLED(HAVE_TMC2130)
903
-  #define STEALTHCHOP
904
-
905
-  /**
906
-   * Let Marlin automatically control stepper current.
907
-   * This is still an experimental feature.
908
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
909
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
910
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
911
-   */
912
-  //#define AUTOMATIC_CURRENT_CONTROL
913
-  #define CURRENT_STEP          50  // [mA]
914
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
915
 
903
 
916
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
904
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
917
   //#define X_IS_TMC2130
905
   //#define X_IS_TMC2130
934
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
922
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
935
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
923
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
936
 
924
 
937
-  #define X_MAX_CURRENT     1000  // rms current in mA
938
-  #define X_MICROSTEPS        16  // FULLSTEP..256
939
-  #define X_CHIP_SELECT       40  // Pin
925
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
926
+  #define X_MICROSTEPS        16  // 0..256
940
 
927
 
941
-  #define Y_MAX_CURRENT     1000
928
+  #define Y_CURRENT         1000
942
   #define Y_MICROSTEPS        16
929
   #define Y_MICROSTEPS        16
943
-  #define Y_CHIP_SELECT       42
944
 
930
 
945
-  #define Z_MAX_CURRENT     1000
931
+  #define Z_CURRENT         1000
946
   #define Z_MICROSTEPS        16
932
   #define Z_MICROSTEPS        16
947
-  #define Z_CHIP_SELECT       65
948
 
933
 
949
-  //#define X2_MAX_CURRENT  1000
934
+  //#define X2_CURRENT      1000
950
   //#define X2_MICROSTEPS     16
935
   //#define X2_MICROSTEPS     16
951
-  //#define X2_CHIP_SELECT    -1
952
 
936
 
953
-  //#define Y2_MAX_CURRENT  1000
937
+  //#define Y2_CURRENT      1000
954
   //#define Y2_MICROSTEPS     16
938
   //#define Y2_MICROSTEPS     16
955
-  //#define Y2_CHIP_SELECT    -1
956
 
939
 
957
-  //#define Z2_MAX_CURRENT  1000
940
+  //#define Z2_CURRENT      1000
958
   //#define Z2_MICROSTEPS     16
941
   //#define Z2_MICROSTEPS     16
959
-  //#define Z2_CHIP_SELECT    -1
960
 
942
 
961
-  //#define E0_MAX_CURRENT  1000
943
+  //#define E0_CURRENT      1000
962
   //#define E0_MICROSTEPS     16
944
   //#define E0_MICROSTEPS     16
963
-  //#define E0_CHIP_SELECT    -1
964
 
945
 
965
-  //#define E1_MAX_CURRENT  1000
946
+  //#define E1_CURRENT      1000
966
   //#define E1_MICROSTEPS     16
947
   //#define E1_MICROSTEPS     16
967
-  //#define E1_CHIP_SELECT    -1
968
 
948
 
969
-  //#define E2_MAX_CURRENT  1000
949
+  //#define E2_CURRENT      1000
970
   //#define E2_MICROSTEPS     16
950
   //#define E2_MICROSTEPS     16
971
-  //#define E2_CHIP_SELECT    -1
972
 
951
 
973
-  //#define E3_MAX_CURRENT  1000
952
+  //#define E3_CURRENT      1000
974
   //#define E3_MICROSTEPS     16
953
   //#define E3_MICROSTEPS     16
975
-  //#define E3_CHIP_SELECT    -1
954
+
955
+  //#define E4_CURRENT      1000
956
+  //#define E4_MICROSTEPS     16
957
+
958
+  /**
959
+   * Use Trinamic's ultra quiet stepping mode.
960
+   * When disabled, Marlin will use spreadCycle stepping mode.
961
+   */
962
+  #define STEALTHCHOP
963
+
964
+  /**
965
+   * Let Marlin automatically control stepper current.
966
+   * This is still an experimental feature.
967
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
968
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
969
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
970
+   * Relevant g-codes:
971
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
972
+   * M906 S1 - Start adjusting current
973
+   * M906 S0 - Stop adjusting current
974
+   * M911 - Report stepper driver overtemperature pre-warn condition.
975
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
976
+   */
977
+  //#define AUTOMATIC_CURRENT_CONTROL
978
+
979
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
980
+    #define CURRENT_STEP          50  // [mA]
981
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
982
+    #define REPORT_CURRENT_CHANGE
983
+  #endif
984
+
985
+  /**
986
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
987
+   * This mode allows for faster movements at the expense of higher noise levels.
988
+   * STEALTHCHOP needs to be enabled.
989
+   * M913 X/Y/Z/E to live tune the setting
990
+   */
991
+  //#define HYBRID_THRESHOLD
992
+
993
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
994
+  #define X2_HYBRID_THRESHOLD    100
995
+  #define Y_HYBRID_THRESHOLD     100
996
+  #define Y2_HYBRID_THRESHOLD    100
997
+  #define Z_HYBRID_THRESHOLD       4
998
+  #define Z2_HYBRID_THRESHOLD      4
999
+  #define E0_HYBRID_THRESHOLD     30
1000
+  #define E1_HYBRID_THRESHOLD     30
1001
+  #define E2_HYBRID_THRESHOLD     30
1002
+  #define E3_HYBRID_THRESHOLD     30
1003
+  #define E4_HYBRID_THRESHOLD     30
1004
+
1005
+  /**
1006
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
1007
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
1008
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
1009
+   *
1010
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
1011
+   * Higher values make the system LESS sensitive.
1012
+   * Lower value make the system MORE sensitive.
1013
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
1014
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
1015
+   * M914 X/Y to live tune the setting
1016
+   */
1017
+  //#define SENSORLESS_HOMING
1018
+
1019
+  #if ENABLED(SENSORLESS_HOMING)
1020
+    #define X_HOMING_SENSITIVITY  19
1021
+    #define Y_HOMING_SENSITIVITY  19
1022
+  #endif
976
 
1023
 
977
   /**
1024
   /**
978
    * You can set your own advanced settings by filling in predefined functions.
1025
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/makibox/Configuration.h View File

1526
  * Enable support for an RGB LED connected to 5V digital pins, or
1526
  * Enable support for an RGB LED connected to 5V digital pins, or
1527
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1527
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1528
  *
1528
  *
1529
- * Adds the M150 command to set the LED (or LED strip) color. 
1529
+ * Adds the M150 command to set the LED (or LED strip) color.
1530
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1530
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1531
  * luminance values can be set from 0 to 255.
1531
  * luminance values can be set from 0 to 255.
1532
  *
1532
  *

+ 80
- 33
Marlin/example_configurations/makibox/Configuration_adv.h View File

879
 //#define HAVE_TMC2130
879
 //#define HAVE_TMC2130
880
 
880
 
881
 #if ENABLED(HAVE_TMC2130)
881
 #if ENABLED(HAVE_TMC2130)
882
-  #define STEALTHCHOP
883
-
884
-  /**
885
-   * Let Marlin automatically control stepper current.
886
-   * This is still an experimental feature.
887
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
888
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
889
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
890
-   */
891
-  //#define AUTOMATIC_CURRENT_CONTROL
892
-  #define CURRENT_STEP          50  // [mA]
893
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
894
 
882
 
895
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
883
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   //#define X_IS_TMC2130
884
   //#define X_IS_TMC2130
913
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
901
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
902
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
 
903
 
916
-  #define X_MAX_CURRENT     1000  // rms current in mA
917
-  #define X_MICROSTEPS        16  // FULLSTEP..256
918
-  #define X_CHIP_SELECT       40  // Pin
904
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
905
+  #define X_MICROSTEPS        16  // 0..256
919
 
906
 
920
-  #define Y_MAX_CURRENT     1000
907
+  #define Y_CURRENT         1000
921
   #define Y_MICROSTEPS        16
908
   #define Y_MICROSTEPS        16
922
-  #define Y_CHIP_SELECT       42
923
 
909
 
924
-  #define Z_MAX_CURRENT     1000
910
+  #define Z_CURRENT         1000
925
   #define Z_MICROSTEPS        16
911
   #define Z_MICROSTEPS        16
926
-  #define Z_CHIP_SELECT       65
927
 
912
 
928
-  //#define X2_MAX_CURRENT  1000
913
+  //#define X2_CURRENT      1000
929
   //#define X2_MICROSTEPS     16
914
   //#define X2_MICROSTEPS     16
930
-  //#define X2_CHIP_SELECT    -1
931
 
915
 
932
-  //#define Y2_MAX_CURRENT  1000
916
+  //#define Y2_CURRENT      1000
933
   //#define Y2_MICROSTEPS     16
917
   //#define Y2_MICROSTEPS     16
934
-  //#define Y2_CHIP_SELECT    -1
935
 
918
 
936
-  //#define Z2_MAX_CURRENT  1000
919
+  //#define Z2_CURRENT      1000
937
   //#define Z2_MICROSTEPS     16
920
   //#define Z2_MICROSTEPS     16
938
-  //#define Z2_CHIP_SELECT    -1
939
 
921
 
940
-  //#define E0_MAX_CURRENT  1000
922
+  //#define E0_CURRENT      1000
941
   //#define E0_MICROSTEPS     16
923
   //#define E0_MICROSTEPS     16
942
-  //#define E0_CHIP_SELECT    -1
943
 
924
 
944
-  //#define E1_MAX_CURRENT  1000
925
+  //#define E1_CURRENT      1000
945
   //#define E1_MICROSTEPS     16
926
   //#define E1_MICROSTEPS     16
946
-  //#define E1_CHIP_SELECT    -1
947
 
927
 
948
-  //#define E2_MAX_CURRENT  1000
928
+  //#define E2_CURRENT      1000
949
   //#define E2_MICROSTEPS     16
929
   //#define E2_MICROSTEPS     16
950
-  //#define E2_CHIP_SELECT    -1
951
 
930
 
952
-  //#define E3_MAX_CURRENT  1000
931
+  //#define E3_CURRENT      1000
953
   //#define E3_MICROSTEPS     16
932
   //#define E3_MICROSTEPS     16
954
-  //#define E3_CHIP_SELECT    -1
933
+
934
+  //#define E4_CURRENT      1000
935
+  //#define E4_MICROSTEPS     16
936
+
937
+  /**
938
+   * Use Trinamic's ultra quiet stepping mode.
939
+   * When disabled, Marlin will use spreadCycle stepping mode.
940
+   */
941
+  #define STEALTHCHOP
942
+
943
+  /**
944
+   * Let Marlin automatically control stepper current.
945
+   * This is still an experimental feature.
946
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
947
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
948
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
949
+   * Relevant g-codes:
950
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
951
+   * M906 S1 - Start adjusting current
952
+   * M906 S0 - Stop adjusting current
953
+   * M911 - Report stepper driver overtemperature pre-warn condition.
954
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
955
+   */
956
+  //#define AUTOMATIC_CURRENT_CONTROL
957
+
958
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
959
+    #define CURRENT_STEP          50  // [mA]
960
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
961
+    #define REPORT_CURRENT_CHANGE
962
+  #endif
963
+
964
+  /**
965
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
966
+   * This mode allows for faster movements at the expense of higher noise levels.
967
+   * STEALTHCHOP needs to be enabled.
968
+   * M913 X/Y/Z/E to live tune the setting
969
+   */
970
+  //#define HYBRID_THRESHOLD
971
+
972
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
973
+  #define X2_HYBRID_THRESHOLD    100
974
+  #define Y_HYBRID_THRESHOLD     100
975
+  #define Y2_HYBRID_THRESHOLD    100
976
+  #define Z_HYBRID_THRESHOLD       4
977
+  #define Z2_HYBRID_THRESHOLD      4
978
+  #define E0_HYBRID_THRESHOLD     30
979
+  #define E1_HYBRID_THRESHOLD     30
980
+  #define E2_HYBRID_THRESHOLD     30
981
+  #define E3_HYBRID_THRESHOLD     30
982
+  #define E4_HYBRID_THRESHOLD     30
983
+
984
+  /**
985
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
986
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
987
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
988
+   *
989
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
990
+   * Higher values make the system LESS sensitive.
991
+   * Lower value make the system MORE sensitive.
992
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
993
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
994
+   * M914 X/Y to live tune the setting
995
+   */
996
+  //#define SENSORLESS_HOMING
997
+
998
+  #if ENABLED(SENSORLESS_HOMING)
999
+    #define X_HOMING_SENSITIVITY  19
1000
+    #define Y_HOMING_SENSITIVITY  19
1001
+  #endif
955
 
1002
 
956
   /**
1003
   /**
957
    * You can set your own advanced settings by filling in predefined functions.
1004
    * You can set your own advanced settings by filling in predefined functions.

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

1519
  * Enable support for an RGB LED connected to 5V digital pins, or
1519
  * Enable support for an RGB LED connected to 5V digital pins, or
1520
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1520
  * an RGB Strip connected to MOSFETs controlled by digital pins.
1521
  *
1521
  *
1522
- * Adds the M150 command to set the LED (or LED strip) color. 
1522
+ * Adds the M150 command to set the LED (or LED strip) color.
1523
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1523
  * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
1524
  * luminance values can be set from 0 to 255.
1524
  * luminance values can be set from 0 to 255.
1525
  *
1525
  *

+ 80
- 33
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

879
 //#define HAVE_TMC2130
879
 //#define HAVE_TMC2130
880
 
880
 
881
 #if ENABLED(HAVE_TMC2130)
881
 #if ENABLED(HAVE_TMC2130)
882
-  #define STEALTHCHOP
883
-
884
-  /**
885
-   * Let Marlin automatically control stepper current.
886
-   * This is still an experimental feature.
887
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
888
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
889
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
890
-   */
891
-  //#define AUTOMATIC_CURRENT_CONTROL
892
-  #define CURRENT_STEP          50  // [mA]
893
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
894
 
882
 
895
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
883
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
896
   //#define X_IS_TMC2130
884
   //#define X_IS_TMC2130
913
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
901
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
914
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
902
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
915
 
903
 
916
-  #define X_MAX_CURRENT     1000  // rms current in mA
917
-  #define X_MICROSTEPS        16  // FULLSTEP..256
918
-  #define X_CHIP_SELECT       40  // Pin
904
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
905
+  #define X_MICROSTEPS        16  // 0..256
919
 
906
 
920
-  #define Y_MAX_CURRENT     1000
907
+  #define Y_CURRENT         1000
921
   #define Y_MICROSTEPS        16
908
   #define Y_MICROSTEPS        16
922
-  #define Y_CHIP_SELECT       42
923
 
909
 
924
-  #define Z_MAX_CURRENT     1000
910
+  #define Z_CURRENT         1000
925
   #define Z_MICROSTEPS        16
911
   #define Z_MICROSTEPS        16
926
-  #define Z_CHIP_SELECT       65
927
 
912
 
928
-  //#define X2_MAX_CURRENT  1000
913
+  //#define X2_CURRENT      1000
929
   //#define X2_MICROSTEPS     16
914
   //#define X2_MICROSTEPS     16
930
-  //#define X2_CHIP_SELECT    -1
931
 
915
 
932
-  //#define Y2_MAX_CURRENT  1000
916
+  //#define Y2_CURRENT      1000
933
   //#define Y2_MICROSTEPS     16
917
   //#define Y2_MICROSTEPS     16
934
-  //#define Y2_CHIP_SELECT    -1
935
 
918
 
936
-  //#define Z2_MAX_CURRENT  1000
919
+  //#define Z2_CURRENT      1000
937
   //#define Z2_MICROSTEPS     16
920
   //#define Z2_MICROSTEPS     16
938
-  //#define Z2_CHIP_SELECT    -1
939
 
921
 
940
-  //#define E0_MAX_CURRENT  1000
922
+  //#define E0_CURRENT      1000
941
   //#define E0_MICROSTEPS     16
923
   //#define E0_MICROSTEPS     16
942
-  //#define E0_CHIP_SELECT    -1
943
 
924
 
944
-  //#define E1_MAX_CURRENT  1000
925
+  //#define E1_CURRENT      1000
945
   //#define E1_MICROSTEPS     16
926
   //#define E1_MICROSTEPS     16
946
-  //#define E1_CHIP_SELECT    -1
947
 
927
 
948
-  //#define E2_MAX_CURRENT  1000
928
+  //#define E2_CURRENT      1000
949
   //#define E2_MICROSTEPS     16
929
   //#define E2_MICROSTEPS     16
950
-  //#define E2_CHIP_SELECT    -1
951
 
930
 
952
-  //#define E3_MAX_CURRENT  1000
931
+  //#define E3_CURRENT      1000
953
   //#define E3_MICROSTEPS     16
932
   //#define E3_MICROSTEPS     16
954
-  //#define E3_CHIP_SELECT    -1
933
+
934
+  //#define E4_CURRENT      1000
935
+  //#define E4_MICROSTEPS     16
936
+
937
+  /**
938
+   * Use Trinamic's ultra quiet stepping mode.
939
+   * When disabled, Marlin will use spreadCycle stepping mode.
940
+   */
941
+  #define STEALTHCHOP
942
+
943
+  /**
944
+   * Let Marlin automatically control stepper current.
945
+   * This is still an experimental feature.
946
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
947
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
948
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
949
+   * Relevant g-codes:
950
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
951
+   * M906 S1 - Start adjusting current
952
+   * M906 S0 - Stop adjusting current
953
+   * M911 - Report stepper driver overtemperature pre-warn condition.
954
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
955
+   */
956
+  //#define AUTOMATIC_CURRENT_CONTROL
957
+
958
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
959
+    #define CURRENT_STEP          50  // [mA]
960
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
961
+    #define REPORT_CURRENT_CHANGE
962
+  #endif
963
+
964
+  /**
965
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
966
+   * This mode allows for faster movements at the expense of higher noise levels.
967
+   * STEALTHCHOP needs to be enabled.
968
+   * M913 X/Y/Z/E to live tune the setting
969
+   */
970
+  //#define HYBRID_THRESHOLD
971
+
972
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
973
+  #define X2_HYBRID_THRESHOLD    100
974
+  #define Y_HYBRID_THRESHOLD     100
975
+  #define Y2_HYBRID_THRESHOLD    100
976
+  #define Z_HYBRID_THRESHOLD       4
977
+  #define Z2_HYBRID_THRESHOLD      4
978
+  #define E0_HYBRID_THRESHOLD     30
979
+  #define E1_HYBRID_THRESHOLD     30
980
+  #define E2_HYBRID_THRESHOLD     30
981
+  #define E3_HYBRID_THRESHOLD     30
982
+  #define E4_HYBRID_THRESHOLD     30
983
+
984
+  /**
985
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
986
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
987
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
988
+   *
989
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
990
+   * Higher values make the system LESS sensitive.
991
+   * Lower value make the system MORE sensitive.
992
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
993
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
994
+   * M914 X/Y to live tune the setting
995
+   */
996
+  //#define SENSORLESS_HOMING
997
+
998
+  #if ENABLED(SENSORLESS_HOMING)
999
+    #define X_HOMING_SENSITIVITY  19
1000
+    #define Y_HOMING_SENSITIVITY  19
1001
+  #endif
955
 
1002
 
956
   /**
1003
   /**
957
    * You can set your own advanced settings by filling in predefined functions.
1004
    * You can set your own advanced settings by filling in predefined functions.

+ 80
- 33
Marlin/example_configurations/wt150/Configuration_adv.h View File

882
 //#define HAVE_TMC2130
882
 //#define HAVE_TMC2130
883
 
883
 
884
 #if ENABLED(HAVE_TMC2130)
884
 #if ENABLED(HAVE_TMC2130)
885
-  #define STEALTHCHOP
886
-
887
-  /**
888
-   * Let Marlin automatically control stepper current.
889
-   * This is still an experimental feature.
890
-   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
891
-   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
892
-   * Adjusting starts from X/Y/Z/E_MAX_CURRENT but will not increase over AUTO_ADJUST_MAX
893
-   */
894
-  //#define AUTOMATIC_CURRENT_CONTROL
895
-  #define CURRENT_STEP          50  // [mA]
896
-  #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
897
 
885
 
898
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
886
   // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
899
   //#define X_IS_TMC2130
887
   //#define X_IS_TMC2130
916
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
904
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
917
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
905
   #define INTERPOLATE          1  // Interpolate X/Y/Z_MICROSTEPS to 256
918
 
906
 
919
-  #define X_MAX_CURRENT     1000  // rms current in mA
920
-  #define X_MICROSTEPS        16  // FULLSTEP..256
921
-  #define X_CHIP_SELECT       40  // Pin
907
+  #define X_CURRENT         1000  // rms current in mA. Multiply by 1.41 for peak current.
908
+  #define X_MICROSTEPS        16  // 0..256
922
 
909
 
923
-  #define Y_MAX_CURRENT     1000
910
+  #define Y_CURRENT         1000
924
   #define Y_MICROSTEPS        16
911
   #define Y_MICROSTEPS        16
925
-  #define Y_CHIP_SELECT       42
926
 
912
 
927
-  #define Z_MAX_CURRENT     1000
913
+  #define Z_CURRENT         1000
928
   #define Z_MICROSTEPS        16
914
   #define Z_MICROSTEPS        16
929
-  #define Z_CHIP_SELECT       65
930
 
915
 
931
-  //#define X2_MAX_CURRENT  1000
916
+  //#define X2_CURRENT      1000
932
   //#define X2_MICROSTEPS     16
917
   //#define X2_MICROSTEPS     16
933
-  //#define X2_CHIP_SELECT    -1
934
 
918
 
935
-  //#define Y2_MAX_CURRENT  1000
919
+  //#define Y2_CURRENT      1000
936
   //#define Y2_MICROSTEPS     16
920
   //#define Y2_MICROSTEPS     16
937
-  //#define Y2_CHIP_SELECT    -1
938
 
921
 
939
-  //#define Z2_MAX_CURRENT  1000
922
+  //#define Z2_CURRENT      1000
940
   //#define Z2_MICROSTEPS     16
923
   //#define Z2_MICROSTEPS     16
941
-  //#define Z2_CHIP_SELECT    -1
942
 
924
 
943
-  //#define E0_MAX_CURRENT  1000
925
+  //#define E0_CURRENT      1000
944
   //#define E0_MICROSTEPS     16
926
   //#define E0_MICROSTEPS     16
945
-  //#define E0_CHIP_SELECT    -1
946
 
927
 
947
-  //#define E1_MAX_CURRENT  1000
928
+  //#define E1_CURRENT      1000
948
   //#define E1_MICROSTEPS     16
929
   //#define E1_MICROSTEPS     16
949
-  //#define E1_CHIP_SELECT    -1
950
 
930
 
951
-  //#define E2_MAX_CURRENT  1000
931
+  //#define E2_CURRENT      1000
952
   //#define E2_MICROSTEPS     16
932
   //#define E2_MICROSTEPS     16
953
-  //#define E2_CHIP_SELECT    -1
954
 
933
 
955
-  //#define E3_MAX_CURRENT  1000
934
+  //#define E3_CURRENT      1000
956
   //#define E3_MICROSTEPS     16
935
   //#define E3_MICROSTEPS     16
957
-  //#define E3_CHIP_SELECT    -1
936
+
937
+  //#define E4_CURRENT      1000
938
+  //#define E4_MICROSTEPS     16
939
+
940
+  /**
941
+   * Use Trinamic's ultra quiet stepping mode.
942
+   * When disabled, Marlin will use spreadCycle stepping mode.
943
+   */
944
+  #define STEALTHCHOP
945
+
946
+  /**
947
+   * Let Marlin automatically control stepper current.
948
+   * This is still an experimental feature.
949
+   * Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
950
+   * then decrease current by CURRENT_STEP until temperature prewarn is cleared.
951
+   * Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
952
+   * Relevant g-codes:
953
+   * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
954
+   * M906 S1 - Start adjusting current
955
+   * M906 S0 - Stop adjusting current
956
+   * M911 - Report stepper driver overtemperature pre-warn condition.
957
+   * M912 - Clear stepper driver overtemperature pre-warn condition flag.
958
+   */
959
+  //#define AUTOMATIC_CURRENT_CONTROL
960
+
961
+  #if ENABLED(AUTOMATIC_CURRENT_CONTROL)
962
+    #define CURRENT_STEP          50  // [mA]
963
+    #define AUTO_ADJUST_MAX     1300  // [mA], 1300mA_rms = 1840mA_peak
964
+    #define REPORT_CURRENT_CHANGE
965
+  #endif
966
+
967
+  /**
968
+   * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
969
+   * This mode allows for faster movements at the expense of higher noise levels.
970
+   * STEALTHCHOP needs to be enabled.
971
+   * M913 X/Y/Z/E to live tune the setting
972
+   */
973
+  //#define HYBRID_THRESHOLD
974
+
975
+  #define X_HYBRID_THRESHOLD     100  // [mm/s]
976
+  #define X2_HYBRID_THRESHOLD    100
977
+  #define Y_HYBRID_THRESHOLD     100
978
+  #define Y2_HYBRID_THRESHOLD    100
979
+  #define Z_HYBRID_THRESHOLD       4
980
+  #define Z2_HYBRID_THRESHOLD      4
981
+  #define E0_HYBRID_THRESHOLD     30
982
+  #define E1_HYBRID_THRESHOLD     30
983
+  #define E2_HYBRID_THRESHOLD     30
984
+  #define E3_HYBRID_THRESHOLD     30
985
+  #define E4_HYBRID_THRESHOLD     30
986
+
987
+  /**
988
+   * Use stallGuard2 to sense an obstacle and trigger an endstop.
989
+   * You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
990
+   * If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
991
+   *
992
+   * X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
993
+   * Higher values make the system LESS sensitive.
994
+   * Lower value make the system MORE sensitive.
995
+   * Too low values can lead to false positives, while too high values will collide the axis without triggering.
996
+   * It is advised to set X/Y_HOME_BUMP_MM to 0.
997
+   * M914 X/Y to live tune the setting
998
+   */
999
+  //#define SENSORLESS_HOMING
1000
+
1001
+  #if ENABLED(SENSORLESS_HOMING)
1002
+    #define X_HOMING_SENSITIVITY  19
1003
+    #define Y_HOMING_SENSITIVITY  19
1004
+  #endif
958
 
1005
 
959
   /**
1006
   /**
960
    * You can set your own advanced settings by filling in predefined functions.
1007
    * You can set your own advanced settings by filling in predefined functions.

+ 38
- 24
Marlin/stepper_indirection.cpp View File

129
 
129
 
130
   #include <SPI.h>
130
   #include <SPI.h>
131
   #include <TMC2130Stepper.h>
131
   #include <TMC2130Stepper.h>
132
+  #include "enum.h"
132
 
133
 
133
-  #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CHIP_SELECT)
134
+  #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN)
134
 
135
 
135
   // Stepper objects of TMC2130 steppers used
136
   // Stepper objects of TMC2130 steppers used
136
   #if ENABLED(X_IS_TMC2130)
137
   #if ENABLED(X_IS_TMC2130)
169
 
170
 
170
   // Use internal reference voltage for current calculations. This is the default.
171
   // Use internal reference voltage for current calculations. This is the default.
171
   // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609)
172
   // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609)
172
-  void tmc2130_init(TMC2130Stepper &st, const uint16_t max_current, const uint16_t microsteps) {
173
+  // https://www.trinamic.com/products/integrated-circuits/details/tmc2130/
174
+  void tmc2130_init(TMC2130Stepper &st, const uint16_t microsteps, const uint32_t thrs, const uint32_t spmm) {
173
     st.begin();
175
     st.begin();
174
     st.setCurrent(st.getCurrent(), R_SENSE, HOLD_MULTIPLIER);
176
     st.setCurrent(st.getCurrent(), R_SENSE, HOLD_MULTIPLIER);
175
     st.microsteps(microsteps);
177
     st.microsteps(microsteps);
176
-    st.blank_time(24);
177
-    st.off_time(8);
178
+    st.blank_time(36);
179
+    st.off_time(5); // Only enables the driver if used with stealthChop
178
     st.interpolate(INTERPOLATE);
180
     st.interpolate(INTERPOLATE);
181
+    st.power_down_delay(128); // ~2s until driver lowers to hold current
182
+    st.hysterisis_start(0); // HSTRT = 1
183
+    st.hysterisis_low(1); // HEND = -2
184
+    st.diag1_active_high(1); // For sensorless homing
179
     #if ENABLED(STEALTHCHOP)
185
     #if ENABLED(STEALTHCHOP)
186
+      st.stealth_freq(1); // f_pwm = 2/683 f_clk
187
+      st.stealth_autoscale(1);
188
+      st.stealth_gradient(5);
189
+      st.stealth_amplitude(255);
180
       st.stealthChop(1);
190
       st.stealthChop(1);
181
-    #endif
182
-    #if ENABLED(SENSORLESS_HOMING)
183
-      st.coolstep_min_speed(1048575);
184
-      st.sg_stall_value(STALL_THRESHOLD);
185
-      st.sg_filter(1);
186
-      st.diag1_stall(1);
187
-      st.diag1_active_high(1);
191
+      #if ENABLED(HYBRID_THRESHOLD)
192
+        st.stealth_max_speed(12650000UL*st.microsteps()/(256*thrs*spmm));
193
+      #endif
194
+    #elif ENABLED(SENSORLESS_HOMING)
195
+      st.coolstep_min_speed(1024UL * 1024UL - 1UL);
188
     #endif
196
     #endif
189
   }
197
   }
190
 
198
 
191
-  #define _TMC2130_INIT(ST) tmc2130_init(stepper##ST, ST##_MAX_CURRENT, ST##_MICROSTEPS)
199
+  #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM)
192
 
200
 
193
   void tmc2130_init() {
201
   void tmc2130_init() {
194
-    delay(500); // Let power stabilize before configuring the steppers
202
+    constexpr uint16_t steps_per_mm[] = DEFAULT_AXIS_STEPS_PER_UNIT;
195
     #if ENABLED(X_IS_TMC2130)
203
     #if ENABLED(X_IS_TMC2130)
196
-      _TMC2130_INIT(X);
204
+      _TMC2130_INIT( X, steps_per_mm[X_AXIS]);
205
+      #if ENABLED(SENSORLESS_HOMING)
206
+        stepperX.sg_stall_value(X_HOMING_SENSITIVITY);
207
+      #endif
197
     #endif
208
     #endif
198
     #if ENABLED(X2_IS_TMC2130)
209
     #if ENABLED(X2_IS_TMC2130)
199
-      _TMC2130_INIT(X2);
210
+      _TMC2130_INIT(X2, steps_per_mm[X_AXIS]);
200
     #endif
211
     #endif
201
     #if ENABLED(Y_IS_TMC2130)
212
     #if ENABLED(Y_IS_TMC2130)
202
-      _TMC2130_INIT(Y);
213
+      _TMC2130_INIT( Y, steps_per_mm[Y_AXIS]);
214
+      #if ENABLED(SENSORLESS_HOMING)
215
+        stepperY.sg_stall_value(Y_HOMING_SENSITIVITY);
216
+      #endif
203
     #endif
217
     #endif
204
     #if ENABLED(Y2_IS_TMC2130)
218
     #if ENABLED(Y2_IS_TMC2130)
205
-      _TMC2130_INIT(Y2);
219
+      _TMC2130_INIT(Y2, steps_per_mm[Y_AXIS]);
206
     #endif
220
     #endif
207
     #if ENABLED(Z_IS_TMC2130)
221
     #if ENABLED(Z_IS_TMC2130)
208
-      _TMC2130_INIT(Z);
222
+      _TMC2130_INIT( Z, steps_per_mm[Z_AXIS]);
209
     #endif
223
     #endif
210
     #if ENABLED(Z2_IS_TMC2130)
224
     #if ENABLED(Z2_IS_TMC2130)
211
-      _TMC2130_INIT(Z2);
225
+      _TMC2130_INIT(Z2, steps_per_mm[Z_AXIS]);
212
     #endif
226
     #endif
213
     #if ENABLED(E0_IS_TMC2130)
227
     #if ENABLED(E0_IS_TMC2130)
214
-      _TMC2130_INIT(E0);
228
+      _TMC2130_INIT(E0, steps_per_mm[E_AXIS]);
215
     #endif
229
     #endif
216
     #if ENABLED(E1_IS_TMC2130)
230
     #if ENABLED(E1_IS_TMC2130)
217
-      _TMC2130_INIT(E1);
231
+      { constexpr int extruder = 1; _TMC2130_INIT(E1, steps_per_mm[E_AXIS_N]); }
218
     #endif
232
     #endif
219
     #if ENABLED(E2_IS_TMC2130)
233
     #if ENABLED(E2_IS_TMC2130)
220
-      _TMC2130_INIT(E2);
234
+      { constexpr int extruder = 2; _TMC2130_INIT(E2, steps_per_mm[E_AXIS_N]); }
221
     #endif
235
     #endif
222
     #if ENABLED(E3_IS_TMC2130)
236
     #if ENABLED(E3_IS_TMC2130)
223
-      _TMC2130_INIT(E3);
237
+      { constexpr int extruder = 3; _TMC2130_INIT(E3, steps_per_mm[E_AXIS_N]); }
224
     #endif
238
     #endif
225
     #if ENABLED(E4_IS_TMC2130)
239
     #if ENABLED(E4_IS_TMC2130)
226
-      _TMC2130_INIT(E4);
240
+      { constexpr int extruder = 4; _TMC2130_INIT(E4, steps_per_mm[E_AXIS_N]); }
227
     #endif
241
     #endif
228
 
242
 
229
     TMC2130_ADV()
243
     TMC2130_ADV()

Loading…
Cancel
Save