Browse Source

Merge pull request #5179 from thinkyhead/rc_TMC2130

TMC2130 "Silent StepStick" support
Scott Lahteine 8 years ago
parent
commit
14b74181f5
25 changed files with 6137 additions and 1832 deletions
  1. 14
    4
      .travis.yml
  2. 303
    93
      Marlin/Configuration_adv.h
  3. 5
    0
      Marlin/Marlin.ino
  4. 63
    5
      Marlin/Marlin_main.cpp
  5. 304
    93
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  6. 304
    93
      Marlin/example_configurations/Felix/Configuration_adv.h
  7. 304
    93
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  8. 304
    93
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  9. 304
    93
      Marlin/example_configurations/K8200/Configuration_adv.h
  10. 304
    93
      Marlin/example_configurations/K8400/Configuration_adv.h
  11. 304
    93
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  12. 304
    93
      Marlin/example_configurations/SCARA/Configuration_adv.h
  13. 304
    93
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  14. 303
    93
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  15. 304
    93
      Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
  16. 304
    93
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  17. 304
    93
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  18. 304
    93
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  19. 304
    93
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  20. 304
    93
      Marlin/example_configurations/makibox/Configuration_adv.h
  21. 304
    93
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  22. 5
    0
      Marlin/pins_RAMPS.h
  23. 5
    0
      Marlin/stepper.cpp
  24. 538
    149
      Marlin/stepper_indirection.cpp
  25. 37
    0
      Marlin/stepper_indirection.h

+ 14
- 4
.travis.yml View File

@@ -39,12 +39,16 @@ install:
39 39
   - sudo mv U8glib_Arduino /usr/local/share/arduino/libraries/U8glib
40 40
   #
41 41
   # Install: L6470 Stepper Motor Driver library
42
-  - git clone https://github.com/ameyer/Arduino-L6470.git
43
-  - sudo mv Arduino-L6470/L6470 /usr/local/share/arduino/libraries/L6470
42
+  # - git clone https://github.com/ameyer/Arduino-L6470.git
43
+  # - sudo mv Arduino-L6470/L6470 /usr/local/share/arduino/libraries/L6470
44 44
   #
45 45
   # Install: TMC26X Stepper Motor Controller library
46
-  - git clone https://github.com/trinamic/TMC26XStepper.git
47
-  - sudo mv TMC26XStepper /usr/local/share/arduino/libraries/TMC26XStepper
46
+  # - git clone https://github.com/trinamic/TMC26XStepper.git
47
+  # - sudo mv TMC26XStepper /usr/local/share/arduino/libraries/TMC26XStepper
48
+  #
49
+  # Install: TMC2130 Stepper Motor Controller library
50
+  - git clone https://github.com/MarlinFirmware/Trinamic_TMC2130.git
51
+  - sudo mv Trinamic_TMC2130/Trinamic_TMC2130 /usr/local/share/arduino/libraries/Trinamic_TMC2130
48 52
   #
49 53
 before_script:
50 54
   #
@@ -380,6 +384,12 @@ script:
380 384
   - opt_enable AUTO_BED_LEVELING_BILINEAR FIX_MOUNTED_PROBE USE_ZMIN_PLUG EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER
381 385
   - build_marlin
382 386
   #
387
+  # TMC2130 Config
388
+  #
389
+  - restore_configs
390
+  - opt_enable_adv HAVE_TMC2130DRIVER X_IS_TMC2130 Y_IS_TMC2130 Z_IS_TMC2130 E0_IS_TMC2130
391
+  - build_marlin
392
+  #
383 393
   # tvrrug Config need to check board type for sanguino atmega644p
384 394
   #
385 395
   #- use_example_configs tvrrug/Round2

+ 303
- 93
Marlin/Configuration_adv.h View File

@@ -705,126 +705,336 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
761
+
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
763 968
 
764
-// @section l6470
969
+/**
970
+ * Enable this section if you have L6470 motor drivers.
971
+ * You need to import the L6470 library into the Arduino IDE for this.
972
+ * (https://github.com/ameyer/Arduino-L6470)
973
+ */
765 974
 
766 975
 //#define HAVE_L6470DRIVER
767 976
 #if ENABLED(HAVE_L6470DRIVER)
768 977
 
769 978
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 979
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 980
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 981
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 982
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 983
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 984
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 985
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 986
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 987
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
988
+
989
+  #define X_MICROSTEPS      16 // number of microsteps
990
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
991
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
992
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
993
+
994
+  #define X2_MICROSTEPS     16
995
+  #define X2_K_VAL          50
996
+  #define X2_OVERCURRENT  2000
997
+  #define X2_STALLCURRENT 1500
998
+
999
+  #define Y_MICROSTEPS      16
1000
+  #define Y_K_VAL           50
1001
+  #define Y_OVERCURRENT   2000
1002
+  #define Y_STALLCURRENT  1500
1003
+
1004
+  #define Y2_MICROSTEPS     16
1005
+  #define Y2_K_VAL          50
1006
+  #define Y2_OVERCURRENT  2000
1007
+  #define Y2_STALLCURRENT 1500
1008
+
1009
+  #define Z_MICROSTEPS      16
1010
+  #define Z_K_VAL           50
1011
+  #define Z_OVERCURRENT   2000
1012
+  #define Z_STALLCURRENT  1500
1013
+
1014
+  #define Z2_MICROSTEPS     16
1015
+  #define Z2_K_VAL          50
1016
+  #define Z2_OVERCURRENT  2000
1017
+  #define Z2_STALLCURRENT 1500
1018
+
1019
+  #define E0_MICROSTEPS     16
1020
+  #define E0_K_VAL          50
1021
+  #define E0_OVERCURRENT  2000
1022
+  #define E0_STALLCURRENT 1500
1023
+
1024
+  #define E1_MICROSTEPS     16
1025
+  #define E1_K_VAL          50
1026
+  #define E1_OVERCURRENT  2000
1027
+  #define E1_STALLCURRENT 1500
1028
+
1029
+  #define E2_MICROSTEPS     16
1030
+  #define E2_K_VAL          50
1031
+  #define E2_OVERCURRENT  2000
1032
+  #define E2_STALLCURRENT 1500
1033
+
1034
+  #define E3_MICROSTEPS     16
1035
+  #define E3_K_VAL          50
1036
+  #define E3_OVERCURRENT  2000
1037
+  #define E3_STALLCURRENT 1500
828 1038
 
829 1039
 #endif
830 1040
 

+ 5
- 0
Marlin/Marlin.ino View File

@@ -67,6 +67,11 @@
67 67
   #include <TMC26XStepper.h>
68 68
 #endif
69 69
 
70
+#if ENABLED(HAVE_TMC2130DRIVER)
71
+  #include <SPI.h>
72
+  #include <Trinamic_TMC2130.h>
73
+#endif
74
+
70 75
 #if ENABLED(HAVE_L6470DRIVER)
71 76
   #include <SPI.h>
72 77
   #include <L6470.h>

+ 63
- 5
Marlin/Marlin_main.cpp View File

@@ -5891,6 +5891,58 @@ inline void gcode_M120() { endstops.enable_globally(true); }
5891 5891
  */
5892 5892
 inline void gcode_M121() { endstops.enable_globally(false); }
5893 5893
 
5894
+#if ENABLED(HAVE_TMC2130DRIVER)
5895
+
5896
+  /**
5897
+   * M122: Output Trinamic TMC2130 status to serial output. Very bad formatting.
5898
+   */
5899
+
5900
+  static void tmc2130_report(Trinamic_TMC2130 &stepr, const char *name) {
5901
+    stepr.read_STAT();
5902
+    SERIAL_PROTOCOL(name);
5903
+    SERIAL_PROTOCOL(": ");
5904
+    stepr.isReset() ? SERIAL_PROTOCOLPGM("RESET ") : SERIAL_PROTOCOLPGM("----- ");
5905
+    stepr.isError() ? SERIAL_PROTOCOLPGM("ERROR ") : SERIAL_PROTOCOLPGM("----- ");
5906
+    stepr.isStallguard() ? SERIAL_PROTOCOLPGM("SLGRD ") : SERIAL_PROTOCOLPGM("----- ");
5907
+    stepr.isStandstill() ? SERIAL_PROTOCOLPGM("STILL ") : SERIAL_PROTOCOLPGM("----- ");
5908
+    SERIAL_PROTOCOLLN(stepr.debug());
5909
+  }
5910
+
5911
+  inline void gcode_M122() {
5912
+    SERIAL_PROTOCOLLNPGM("Reporting TMC2130 status");
5913
+    #if ENABLED(X_IS_TMC2130)
5914
+      tmc2130_report(stepperX, "X");
5915
+    #endif
5916
+    #if ENABLED(X2_IS_TMC2130)
5917
+      tmc2130_report(stepperX2, "X2");
5918
+    #endif
5919
+    #if ENABLED(Y_IS_TMC2130)
5920
+      tmc2130_report(stepperY, "Y");
5921
+    #endif
5922
+    #if ENABLED(Y2_IS_TMC2130)
5923
+      tmc2130_report(stepperY2, "Y2");
5924
+    #endif
5925
+    #if ENABLED(Z_IS_TMC2130)
5926
+      tmc2130_report(stepperZ, "Z");
5927
+    #endif
5928
+    #if ENABLED(Z2_IS_TMC2130)
5929
+      tmc2130_report(stepperZ2, "Z2");
5930
+    #endif
5931
+    #if ENABLED(E0_IS_TMC2130)
5932
+      tmc2130_report(stepperE0, "E0");
5933
+    #endif
5934
+    #if ENABLED(E1_IS_TMC2130)
5935
+      tmc2130_report(stepperE1, "E1");
5936
+    #endif
5937
+    #if ENABLED(E2_IS_TMC2130)
5938
+      tmc2130_report(stepperE2, "E2");
5939
+    #endif
5940
+    #if ENABLED(E3_IS_TMC2130)
5941
+      tmc2130_report(stepperE3, "E3");
5942
+    #endif
5943
+  }
5944
+#endif // HAVE_TMC2130DRIVER
5945
+
5894 5946
 #if ENABLED(BLINKM)
5895 5947
 
5896 5948
   /**
@@ -8035,14 +8087,17 @@ void process_next_command() {
8035 8087
       case 92: // M92: Set the steps-per-unit for one or more axes
8036 8088
         gcode_M92();
8037 8089
         break;
8090
+      case 114: // M114: Report current position
8091
+        gcode_M114();
8092
+        break;
8038 8093
       case 115: // M115: Report capabilities
8039 8094
         gcode_M115();
8040 8095
         break;
8041 8096
       case 117: // M117: Set LCD message text, if possible
8042 8097
         gcode_M117();
8043 8098
         break;
8044
-      case 114: // M114: Report current position
8045
-        gcode_M114();
8099
+      case 119: // M119: Report endstop states
8100
+        gcode_M119();
8046 8101
         break;
8047 8102
       case 120: // M120: Enable endstops
8048 8103
         gcode_M120();
@@ -8050,9 +8105,12 @@ void process_next_command() {
8050 8105
       case 121: // M121: Disable endstops
8051 8106
         gcode_M121();
8052 8107
         break;
8053
-      case 119: // M119: Report endstop states
8054
-        gcode_M119();
8055
-        break;
8108
+
8109
+      #if ENABLED(HAVE_TMC2130DRIVER)
8110
+        case 122: // M122: Diagnose, used to debug TMC2130
8111
+          gcode_M122();
8112
+          break;
8113
+      #endif
8056 8114
 
8057 8115
       #if ENABLED(ULTIPANEL)
8058 8116
 

+ 304
- 93
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -705,126 +705,337 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
763 761
 
764
-// @section l6470
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
968
+
969
+
970
+/**
971
+ * Enable this section if you have L6470 motor drivers.
972
+ * You need to import the L6470 library into the Arduino IDE for this.
973
+ * (https://github.com/ameyer/Arduino-L6470)
974
+ */
765 975
 
766 976
 //#define HAVE_L6470DRIVER
767 977
 #if ENABLED(HAVE_L6470DRIVER)
768 978
 
769 979
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 980
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 981
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 982
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 983
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 984
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 985
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 986
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 987
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 988
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
989
+
990
+  #define X_MICROSTEPS      16 // number of microsteps
991
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
992
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
993
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
994
+
995
+  #define X2_MICROSTEPS     16
996
+  #define X2_K_VAL          50
997
+  #define X2_OVERCURRENT  2000
998
+  #define X2_STALLCURRENT 1500
999
+
1000
+  #define Y_MICROSTEPS      16
1001
+  #define Y_K_VAL           50
1002
+  #define Y_OVERCURRENT   2000
1003
+  #define Y_STALLCURRENT  1500
1004
+
1005
+  #define Y2_MICROSTEPS     16
1006
+  #define Y2_K_VAL          50
1007
+  #define Y2_OVERCURRENT  2000
1008
+  #define Y2_STALLCURRENT 1500
1009
+
1010
+  #define Z_MICROSTEPS      16
1011
+  #define Z_K_VAL           50
1012
+  #define Z_OVERCURRENT   2000
1013
+  #define Z_STALLCURRENT  1500
1014
+
1015
+  #define Z2_MICROSTEPS     16
1016
+  #define Z2_K_VAL          50
1017
+  #define Z2_OVERCURRENT  2000
1018
+  #define Z2_STALLCURRENT 1500
1019
+
1020
+  #define E0_MICROSTEPS     16
1021
+  #define E0_K_VAL          50
1022
+  #define E0_OVERCURRENT  2000
1023
+  #define E0_STALLCURRENT 1500
1024
+
1025
+  #define E1_MICROSTEPS     16
1026
+  #define E1_K_VAL          50
1027
+  #define E1_OVERCURRENT  2000
1028
+  #define E1_STALLCURRENT 1500
1029
+
1030
+  #define E2_MICROSTEPS     16
1031
+  #define E2_K_VAL          50
1032
+  #define E2_OVERCURRENT  2000
1033
+  #define E2_STALLCURRENT 1500
1034
+
1035
+  #define E3_MICROSTEPS     16
1036
+  #define E3_K_VAL          50
1037
+  #define E3_OVERCURRENT  2000
1038
+  #define E3_STALLCURRENT 1500
828 1039
 
829 1040
 #endif
830 1041
 

+ 304
- 93
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -705,126 +705,337 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
763 761
 
764
-// @section l6470
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
968
+
969
+
970
+/**
971
+ * Enable this section if you have L6470 motor drivers.
972
+ * You need to import the L6470 library into the Arduino IDE for this.
973
+ * (https://github.com/ameyer/Arduino-L6470)
974
+ */
765 975
 
766 976
 //#define HAVE_L6470DRIVER
767 977
 #if ENABLED(HAVE_L6470DRIVER)
768 978
 
769 979
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 980
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 981
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 982
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 983
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 984
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 985
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 986
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 987
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 988
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
989
+
990
+  #define X_MICROSTEPS      16 // number of microsteps
991
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
992
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
993
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
994
+
995
+  #define X2_MICROSTEPS     16
996
+  #define X2_K_VAL          50
997
+  #define X2_OVERCURRENT  2000
998
+  #define X2_STALLCURRENT 1500
999
+
1000
+  #define Y_MICROSTEPS      16
1001
+  #define Y_K_VAL           50
1002
+  #define Y_OVERCURRENT   2000
1003
+  #define Y_STALLCURRENT  1500
1004
+
1005
+  #define Y2_MICROSTEPS     16
1006
+  #define Y2_K_VAL          50
1007
+  #define Y2_OVERCURRENT  2000
1008
+  #define Y2_STALLCURRENT 1500
1009
+
1010
+  #define Z_MICROSTEPS      16
1011
+  #define Z_K_VAL           50
1012
+  #define Z_OVERCURRENT   2000
1013
+  #define Z_STALLCURRENT  1500
1014
+
1015
+  #define Z2_MICROSTEPS     16
1016
+  #define Z2_K_VAL          50
1017
+  #define Z2_OVERCURRENT  2000
1018
+  #define Z2_STALLCURRENT 1500
1019
+
1020
+  #define E0_MICROSTEPS     16
1021
+  #define E0_K_VAL          50
1022
+  #define E0_OVERCURRENT  2000
1023
+  #define E0_STALLCURRENT 1500
1024
+
1025
+  #define E1_MICROSTEPS     16
1026
+  #define E1_K_VAL          50
1027
+  #define E1_OVERCURRENT  2000
1028
+  #define E1_STALLCURRENT 1500
1029
+
1030
+  #define E2_MICROSTEPS     16
1031
+  #define E2_K_VAL          50
1032
+  #define E2_OVERCURRENT  2000
1033
+  #define E2_STALLCURRENT 1500
1034
+
1035
+  #define E3_MICROSTEPS     16
1036
+  #define E3_K_VAL          50
1037
+  #define E3_OVERCURRENT  2000
1038
+  #define E3_STALLCURRENT 1500
828 1039
 
829 1040
 #endif
830 1041
 

+ 304
- 93
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -705,126 +705,337 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
763 761
 
764
-// @section l6470
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
968
+
969
+
970
+/**
971
+ * Enable this section if you have L6470 motor drivers.
972
+ * You need to import the L6470 library into the Arduino IDE for this.
973
+ * (https://github.com/ameyer/Arduino-L6470)
974
+ */
765 975
 
766 976
 //#define HAVE_L6470DRIVER
767 977
 #if ENABLED(HAVE_L6470DRIVER)
768 978
 
769 979
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 980
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 981
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 982
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 983
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 984
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 985
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 986
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 987
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 988
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
989
+
990
+  #define X_MICROSTEPS      16 // number of microsteps
991
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
992
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
993
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
994
+
995
+  #define X2_MICROSTEPS     16
996
+  #define X2_K_VAL          50
997
+  #define X2_OVERCURRENT  2000
998
+  #define X2_STALLCURRENT 1500
999
+
1000
+  #define Y_MICROSTEPS      16
1001
+  #define Y_K_VAL           50
1002
+  #define Y_OVERCURRENT   2000
1003
+  #define Y_STALLCURRENT  1500
1004
+
1005
+  #define Y2_MICROSTEPS     16
1006
+  #define Y2_K_VAL          50
1007
+  #define Y2_OVERCURRENT  2000
1008
+  #define Y2_STALLCURRENT 1500
1009
+
1010
+  #define Z_MICROSTEPS      16
1011
+  #define Z_K_VAL           50
1012
+  #define Z_OVERCURRENT   2000
1013
+  #define Z_STALLCURRENT  1500
1014
+
1015
+  #define Z2_MICROSTEPS     16
1016
+  #define Z2_K_VAL          50
1017
+  #define Z2_OVERCURRENT  2000
1018
+  #define Z2_STALLCURRENT 1500
1019
+
1020
+  #define E0_MICROSTEPS     16
1021
+  #define E0_K_VAL          50
1022
+  #define E0_OVERCURRENT  2000
1023
+  #define E0_STALLCURRENT 1500
1024
+
1025
+  #define E1_MICROSTEPS     16
1026
+  #define E1_K_VAL          50
1027
+  #define E1_OVERCURRENT  2000
1028
+  #define E1_STALLCURRENT 1500
1029
+
1030
+  #define E2_MICROSTEPS     16
1031
+  #define E2_K_VAL          50
1032
+  #define E2_OVERCURRENT  2000
1033
+  #define E2_STALLCURRENT 1500
1034
+
1035
+  #define E3_MICROSTEPS     16
1036
+  #define E3_K_VAL          50
1037
+  #define E3_OVERCURRENT  2000
1038
+  #define E3_STALLCURRENT 1500
828 1039
 
829 1040
 #endif
830 1041
 

+ 304
- 93
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

@@ -705,126 +705,337 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
763 761
 
764
-// @section l6470
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
968
+
969
+
970
+/**
971
+ * Enable this section if you have L6470 motor drivers.
972
+ * You need to import the L6470 library into the Arduino IDE for this.
973
+ * (https://github.com/ameyer/Arduino-L6470)
974
+ */
765 975
 
766 976
 //#define HAVE_L6470DRIVER
767 977
 #if ENABLED(HAVE_L6470DRIVER)
768 978
 
769 979
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 980
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 981
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 982
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 983
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 984
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 985
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 986
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 987
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 988
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
989
+
990
+  #define X_MICROSTEPS      16 // number of microsteps
991
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
992
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
993
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
994
+
995
+  #define X2_MICROSTEPS     16
996
+  #define X2_K_VAL          50
997
+  #define X2_OVERCURRENT  2000
998
+  #define X2_STALLCURRENT 1500
999
+
1000
+  #define Y_MICROSTEPS      16
1001
+  #define Y_K_VAL           50
1002
+  #define Y_OVERCURRENT   2000
1003
+  #define Y_STALLCURRENT  1500
1004
+
1005
+  #define Y2_MICROSTEPS     16
1006
+  #define Y2_K_VAL          50
1007
+  #define Y2_OVERCURRENT  2000
1008
+  #define Y2_STALLCURRENT 1500
1009
+
1010
+  #define Z_MICROSTEPS      16
1011
+  #define Z_K_VAL           50
1012
+  #define Z_OVERCURRENT   2000
1013
+  #define Z_STALLCURRENT  1500
1014
+
1015
+  #define Z2_MICROSTEPS     16
1016
+  #define Z2_K_VAL          50
1017
+  #define Z2_OVERCURRENT  2000
1018
+  #define Z2_STALLCURRENT 1500
1019
+
1020
+  #define E0_MICROSTEPS     16
1021
+  #define E0_K_VAL          50
1022
+  #define E0_OVERCURRENT  2000
1023
+  #define E0_STALLCURRENT 1500
1024
+
1025
+  #define E1_MICROSTEPS     16
1026
+  #define E1_K_VAL          50
1027
+  #define E1_OVERCURRENT  2000
1028
+  #define E1_STALLCURRENT 1500
1029
+
1030
+  #define E2_MICROSTEPS     16
1031
+  #define E2_K_VAL          50
1032
+  #define E2_OVERCURRENT  2000
1033
+  #define E2_STALLCURRENT 1500
1034
+
1035
+  #define E3_MICROSTEPS     16
1036
+  #define E3_K_VAL          50
1037
+  #define E3_OVERCURRENT  2000
1038
+  #define E3_STALLCURRENT 1500
828 1039
 
829 1040
 #endif
830 1041
 

+ 304
- 93
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -718,126 +718,337 @@
718 718
 #if ENABLED(HAVE_TMCDRIVER)
719 719
 
720 720
   //#define X_IS_TMC
721
-  #define X_MAX_CURRENT 1000  //in mA
722
-  #define X_SENSE_RESISTOR 91 //in mOhms
723
-  #define X_MICROSTEPS 16     //number of microsteps
724
-
725 721
   //#define X2_IS_TMC
726
-  #define X2_MAX_CURRENT 1000  //in mA
727
-  #define X2_SENSE_RESISTOR 91 //in mOhms
728
-  #define X2_MICROSTEPS 16     //number of microsteps
729
-
730 722
   //#define Y_IS_TMC
731
-  #define Y_MAX_CURRENT 1000  //in mA
732
-  #define Y_SENSE_RESISTOR 91 //in mOhms
733
-  #define Y_MICROSTEPS 16     //number of microsteps
734
-
735 723
   //#define Y2_IS_TMC
736
-  #define Y2_MAX_CURRENT 1000  //in mA
737
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
738
-  #define Y2_MICROSTEPS 16     //number of microsteps
739
-
740 724
   //#define Z_IS_TMC
741
-  #define Z_MAX_CURRENT 1000  //in mA
742
-  #define Z_SENSE_RESISTOR 91 //in mOhms
743
-  #define Z_MICROSTEPS 16     //number of microsteps
744
-
745 725
   //#define Z2_IS_TMC
746
-  #define Z2_MAX_CURRENT 1000  //in mA
747
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
748
-  #define Z2_MICROSTEPS 16     //number of microsteps
749
-
750 726
   //#define E0_IS_TMC
751
-  #define E0_MAX_CURRENT 1000  //in mA
752
-  #define E0_SENSE_RESISTOR 91 //in mOhms
753
-  #define E0_MICROSTEPS 16     //number of microsteps
754
-
755 727
   //#define E1_IS_TMC
756
-  #define E1_MAX_CURRENT 1000  //in mA
757
-  #define E1_SENSE_RESISTOR 91 //in mOhms
758
-  #define E1_MICROSTEPS 16     //number of microsteps
759
-
760 728
   //#define E2_IS_TMC
761
-  #define E2_MAX_CURRENT 1000  //in mA
762
-  #define E2_SENSE_RESISTOR 91 //in mOhms
763
-  #define E2_MICROSTEPS 16     //number of microsteps
764
-
765 729
   //#define E3_IS_TMC
766
-  #define E3_MAX_CURRENT 1000  //in mA
767
-  #define E3_SENSE_RESISTOR 91 //in mOhms
768
-  #define E3_MICROSTEPS 16     //number of microsteps
730
+
731
+  #define X_MAX_CURRENT     1000 // in mA
732
+  #define X_SENSE_RESISTOR    91 // in mOhms
733
+  #define X_MICROSTEPS        16 // number of microsteps
734
+
735
+  #define X2_MAX_CURRENT    1000
736
+  #define X2_SENSE_RESISTOR   91
737
+  #define X2_MICROSTEPS       16
738
+
739
+  #define Y_MAX_CURRENT     1000
740
+  #define Y_SENSE_RESISTOR    91
741
+  #define Y_MICROSTEPS        16
742
+
743
+  #define Y2_MAX_CURRENT    1000
744
+  #define Y2_SENSE_RESISTOR   91
745
+  #define Y2_MICROSTEPS       16
746
+
747
+  #define Z_MAX_CURRENT     1000
748
+  #define Z_SENSE_RESISTOR    91
749
+  #define Z_MICROSTEPS        16
750
+
751
+  #define Z2_MAX_CURRENT    1000
752
+  #define Z2_SENSE_RESISTOR   91
753
+  #define Z2_MICROSTEPS       16
754
+
755
+  #define E0_MAX_CURRENT    1000
756
+  #define E0_SENSE_RESISTOR   91
757
+  #define E0_MICROSTEPS       16
758
+
759
+  #define E1_MAX_CURRENT    1000
760
+  #define E1_SENSE_RESISTOR   91
761
+  #define E1_MICROSTEPS       16
762
+
763
+  #define E2_MAX_CURRENT    1000
764
+  #define E2_SENSE_RESISTOR   91
765
+  #define E2_MICROSTEPS       16
766
+
767
+  #define E3_MAX_CURRENT    1000
768
+  #define E3_SENSE_RESISTOR   91
769
+  #define E3_MICROSTEPS       16
769 770
 
770 771
 #endif
771 772
 
772
-/******************************************************************************\
773
- * enable this section if you have L6470  motor drivers.
774
- * you need to import the L6470 library into the Arduino IDE for this
775
- ******************************************************************************/
773
+// @section TMC2130
776 774
 
777
-// @section l6470
775
+
776
+/**
777
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
778
+ *
779
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
780
+ * (https://github.com/makertum/Trinamic_TMC2130).
781
+ *
782
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
783
+ * the hardware SPI interface on your board and define the required CS pins
784
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
785
+ */
786
+
787
+//#define HAVE_TMC2130DRIVER
788
+
789
+#if ENABLED(HAVE_TMC2130DRIVER)
790
+
791
+  //#define TMC2130_ADVANCED_CONFIGURATION
792
+
793
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
794
+  //#define X_IS_TMC2130
795
+  //#define X2_IS_TMC2130
796
+  //#define Y_IS_TMC2130
797
+  //#define Y2_IS_TMC2130
798
+  //#define Z_IS_TMC2130
799
+  //#define Z2_IS_TMC2130
800
+  //#define E0_IS_TMC2130
801
+  //#define E1_IS_TMC2130
802
+  //#define E2_IS_TMC2130
803
+  //#define E3_IS_TMC2130
804
+
805
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
806
+
807
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
808
+    // Enabled settings will be automatically applied to all axes specified above.
809
+    //
810
+    // Please read the TMC2130 datasheet:
811
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
812
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
813
+    //
814
+    // The following, uncommented settings are only suggestion.
815
+
816
+    /* GENERAL CONFIGURATION */
817
+
818
+    //#define GLOBAL_EN_PWM_MODE        0
819
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
820
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
821
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
822
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
823
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
824
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
825
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
826
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
827
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
828
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
829
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
830
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
831
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
832
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
833
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
834
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
835
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
836
+
837
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
838
+
839
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
840
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
841
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
842
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
843
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
844
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
845
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
846
+
847
+    /* SPI MODE CONFIGURATION */
848
+
849
+    //#define GLOBAL_XDIRECT            0
850
+
851
+    /* DCSTEP MINIMUM VELOCITY */
852
+
853
+    //#define GLOBAL_VDCMIN             0
854
+
855
+    /* MOTOR DRIVER CONFIGURATION*/
856
+
857
+    //#define GLOBAL_DEDGE              0
858
+    //#define GLOBAL_DISS2G             0
859
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
860
+    #define GLOBAL_MRES              16 // number of microsteps
861
+    #define GLOBAL_SYNC               1 // [0-15]
862
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
863
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
864
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
865
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
866
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
867
+    //#define GLOBAL_RNDTF              0
868
+    //#define GLOBAL_DISFDCC            0
869
+    //#define GLOBAL_FD                 0
870
+    //#define GLOBAL_HEND               0
871
+    //#define GLOBAL_HSTRT              0
872
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
873
+
874
+    //#define GLOBAL_SFILT              0
875
+    //#define GLOBAL_SGT                0
876
+    //#define GLOBAL_SEIMIN             0
877
+    //#define GLOBAL_SEDN               0
878
+    //#define GLOBAL_SEMAX              0
879
+    //#define GLOBAL_SEUP               0
880
+    //#define GLOBAL_SEMIN              0
881
+
882
+    //#define GLOBAL_DC_TIME            0
883
+    //#define GLOBAL_DC_SG              0
884
+
885
+    //#define GLOBAL_FREEWHEEL          0
886
+    //#define GLOBAL_PWM_SYMMETRIC      0
887
+    //#define GLOBAL_PWM_AUTOSCALE      0
888
+    //#define GLOBAL_PWM_FREQ           0
889
+    //#define GLOBAL_PWM_GRAD           0
890
+    //#define GLOBAL_PWM_AMPL           0
891
+
892
+    //#define GLOBAL_ENCM_CTRL          0
893
+
894
+  #else
895
+
896
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
897
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
898
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
899
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
900
+    #define X_MRES           16 // number of microsteps
901
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
902
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
903
+
904
+    #define X2_IHOLD         31
905
+    #define X2_IRUN          31
906
+    #define X2_IHOLDDELAY    15
907
+    #define X2_I_SCALE_ANALOG 1
908
+    #define X2_MRES          16
909
+    #define X2_TBL            1
910
+    #define X2_TOFF           8
911
+
912
+    #define Y_IHOLD          31
913
+    #define Y_IRUN           31
914
+    #define Y_IHOLDDELAY     15
915
+    #define Y_I_SCALE_ANALOG  1
916
+    #define Y_MRES           16
917
+    #define Y_TBL             1
918
+    #define Y_TOFF            8
919
+
920
+    #define Y2_IHOLD         31
921
+    #define Y2_IRUN          31
922
+    #define Y2_IHOLDDELAY    15
923
+    #define Y2_I_SCALE_ANALOG 1
924
+    #define Y2_MRES          16
925
+    #define Y2_TBL            1
926
+    #define Y2_TOFF           8
927
+
928
+    #define Z_IHOLD          31
929
+    #define Z_IRUN           31
930
+    #define Z_IHOLDDELAY     15
931
+    #define Z_I_SCALE_ANALOG  1
932
+    #define Z_MRES           16
933
+    #define Z_TBL             1
934
+    #define Z_TOFF            8
935
+
936
+    #define Z2_IHOLD         31
937
+    #define Z2_IRUN          31
938
+    #define Z2_IHOLDDELAY    15
939
+    #define Z2_I_SCALE_ANALOG 1
940
+    #define Z2_MRES          16
941
+    #define Z2_TBL            1
942
+    #define Z2_TOFF           8
943
+
944
+    #define E0_IHOLD         31
945
+    #define E0_IRUN          31
946
+    #define E0_IHOLDDELAY    15
947
+    #define E0_I_SCALE_ANALOG 1
948
+    #define E0_MRES          16
949
+    #define E0_TBL            1
950
+    #define E0_TOFF           8
951
+
952
+    #define E1_IHOLD         31
953
+    #define E1_IRUN          31
954
+    #define E1_IHOLDDELAY    15
955
+    #define E1_I_SCALE_ANALOG 1
956
+    #define E1_MRES          16
957
+    #define E1_TBL            1
958
+    #define E1_TOFF           8
959
+
960
+    #define E2_IHOLD         31
961
+    #define E2_IRUN          31
962
+    #define E2_IHOLDDELAY    15
963
+    #define E2_I_SCALE_ANALOG 1
964
+    #define E2_MRES          16
965
+    #define E2_TBL            1
966
+    #define E2_TOFF           8
967
+
968
+    #define E3_IHOLD         31
969
+    #define E3_IRUN          31
970
+    #define E3_IHOLDDELAY    15
971
+    #define E3_I_SCALE_ANALOG 1
972
+    #define E3_MRES          16
973
+    #define E3_TBL            1
974
+    #define E3_TOFF           8
975
+
976
+  #endif // TMC2130_ADVANCED_CONFIGURATION
977
+
978
+#endif // HAVE_TMC2130DRIVER
979
+
980
+// @section L6470
981
+
982
+
983
+/**
984
+ * Enable this section if you have L6470 motor drivers.
985
+ * You need to import the L6470 library into the Arduino IDE for this.
986
+ * (https://github.com/ameyer/Arduino-L6470)
987
+ */
778 988
 
779 989
 //#define HAVE_L6470DRIVER
780 990
 #if ENABLED(HAVE_L6470DRIVER)
781 991
 
782 992
   //#define X_IS_L6470
783
-  #define X_MICROSTEPS 16     //number of microsteps
784
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
785
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
786
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
787
-
788 993
   //#define X2_IS_L6470
789
-  #define X2_MICROSTEPS 16     //number of microsteps
790
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
791
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
792
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
793
-
794 994
   //#define Y_IS_L6470
795
-  #define Y_MICROSTEPS 16     //number of microsteps
796
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
797
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
798
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
799
-
800 995
   //#define Y2_IS_L6470
801
-  #define Y2_MICROSTEPS 16     //number of microsteps
802
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
803
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
804
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
805
-
806 996
   //#define Z_IS_L6470
807
-  #define Z_MICROSTEPS 16     //number of microsteps
808
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
809
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
810
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
811
-
812 997
   //#define Z2_IS_L6470
813
-  #define Z2_MICROSTEPS 16     //number of microsteps
814
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
815
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
816
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
817
-
818 998
   //#define E0_IS_L6470
819
-  #define E0_MICROSTEPS 16     //number of microsteps
820
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
821
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
822
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
823
-
824 999
   //#define E1_IS_L6470
825
-  #define E1_MICROSTEPS 16     //number of microsteps
826
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
827
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
828
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
829
-
830 1000
   //#define E2_IS_L6470
831
-  #define E2_MICROSTEPS 16     //number of microsteps
832
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
833
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
834
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
835
-
836 1001
   //#define E3_IS_L6470
837
-  #define E3_MICROSTEPS 16     //number of microsteps
838
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
839
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
840
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
1002
+
1003
+  #define X_MICROSTEPS      16 // number of microsteps
1004
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
1005
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
1006
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
1007
+
1008
+  #define X2_MICROSTEPS     16
1009
+  #define X2_K_VAL          50
1010
+  #define X2_OVERCURRENT  2000
1011
+  #define X2_STALLCURRENT 1500
1012
+
1013
+  #define Y_MICROSTEPS      16
1014
+  #define Y_K_VAL           50
1015
+  #define Y_OVERCURRENT   2000
1016
+  #define Y_STALLCURRENT  1500
1017
+
1018
+  #define Y2_MICROSTEPS     16
1019
+  #define Y2_K_VAL          50
1020
+  #define Y2_OVERCURRENT  2000
1021
+  #define Y2_STALLCURRENT 1500
1022
+
1023
+  #define Z_MICROSTEPS      16
1024
+  #define Z_K_VAL           50
1025
+  #define Z_OVERCURRENT   2000
1026
+  #define Z_STALLCURRENT  1500
1027
+
1028
+  #define Z2_MICROSTEPS     16
1029
+  #define Z2_K_VAL          50
1030
+  #define Z2_OVERCURRENT  2000
1031
+  #define Z2_STALLCURRENT 1500
1032
+
1033
+  #define E0_MICROSTEPS     16
1034
+  #define E0_K_VAL          50
1035
+  #define E0_OVERCURRENT  2000
1036
+  #define E0_STALLCURRENT 1500
1037
+
1038
+  #define E1_MICROSTEPS     16
1039
+  #define E1_K_VAL          50
1040
+  #define E1_OVERCURRENT  2000
1041
+  #define E1_STALLCURRENT 1500
1042
+
1043
+  #define E2_MICROSTEPS     16
1044
+  #define E2_K_VAL          50
1045
+  #define E2_OVERCURRENT  2000
1046
+  #define E2_STALLCURRENT 1500
1047
+
1048
+  #define E3_MICROSTEPS     16
1049
+  #define E3_K_VAL          50
1050
+  #define E3_OVERCURRENT  2000
1051
+  #define E3_STALLCURRENT 1500
841 1052
 
842 1053
 #endif
843 1054
 

+ 304
- 93
Marlin/example_configurations/K8400/Configuration_adv.h View File

@@ -705,126 +705,337 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
763 761
 
764
-// @section l6470
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
968
+
969
+
970
+/**
971
+ * Enable this section if you have L6470 motor drivers.
972
+ * You need to import the L6470 library into the Arduino IDE for this.
973
+ * (https://github.com/ameyer/Arduino-L6470)
974
+ */
765 975
 
766 976
 //#define HAVE_L6470DRIVER
767 977
 #if ENABLED(HAVE_L6470DRIVER)
768 978
 
769 979
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 980
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 981
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 982
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 983
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 984
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 985
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 986
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 987
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 988
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
989
+
990
+  #define X_MICROSTEPS      16 // number of microsteps
991
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
992
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
993
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
994
+
995
+  #define X2_MICROSTEPS     16
996
+  #define X2_K_VAL          50
997
+  #define X2_OVERCURRENT  2000
998
+  #define X2_STALLCURRENT 1500
999
+
1000
+  #define Y_MICROSTEPS      16
1001
+  #define Y_K_VAL           50
1002
+  #define Y_OVERCURRENT   2000
1003
+  #define Y_STALLCURRENT  1500
1004
+
1005
+  #define Y2_MICROSTEPS     16
1006
+  #define Y2_K_VAL          50
1007
+  #define Y2_OVERCURRENT  2000
1008
+  #define Y2_STALLCURRENT 1500
1009
+
1010
+  #define Z_MICROSTEPS      16
1011
+  #define Z_K_VAL           50
1012
+  #define Z_OVERCURRENT   2000
1013
+  #define Z_STALLCURRENT  1500
1014
+
1015
+  #define Z2_MICROSTEPS     16
1016
+  #define Z2_K_VAL          50
1017
+  #define Z2_OVERCURRENT  2000
1018
+  #define Z2_STALLCURRENT 1500
1019
+
1020
+  #define E0_MICROSTEPS     16
1021
+  #define E0_K_VAL          50
1022
+  #define E0_OVERCURRENT  2000
1023
+  #define E0_STALLCURRENT 1500
1024
+
1025
+  #define E1_MICROSTEPS     16
1026
+  #define E1_K_VAL          50
1027
+  #define E1_OVERCURRENT  2000
1028
+  #define E1_STALLCURRENT 1500
1029
+
1030
+  #define E2_MICROSTEPS     16
1031
+  #define E2_K_VAL          50
1032
+  #define E2_OVERCURRENT  2000
1033
+  #define E2_STALLCURRENT 1500
1034
+
1035
+  #define E3_MICROSTEPS     16
1036
+  #define E3_K_VAL          50
1037
+  #define E3_OVERCURRENT  2000
1038
+  #define E3_STALLCURRENT 1500
828 1039
 
829 1040
 #endif
830 1041
 

+ 304
- 93
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -705,126 +705,337 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
763 761
 
764
-// @section l6470
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
968
+
969
+
970
+/**
971
+ * Enable this section if you have L6470 motor drivers.
972
+ * You need to import the L6470 library into the Arduino IDE for this.
973
+ * (https://github.com/ameyer/Arduino-L6470)
974
+ */
765 975
 
766 976
 //#define HAVE_L6470DRIVER
767 977
 #if ENABLED(HAVE_L6470DRIVER)
768 978
 
769 979
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 980
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 981
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 982
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 983
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 984
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 985
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 986
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 987
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 988
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
989
+
990
+  #define X_MICROSTEPS      16 // number of microsteps
991
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
992
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
993
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
994
+
995
+  #define X2_MICROSTEPS     16
996
+  #define X2_K_VAL          50
997
+  #define X2_OVERCURRENT  2000
998
+  #define X2_STALLCURRENT 1500
999
+
1000
+  #define Y_MICROSTEPS      16
1001
+  #define Y_K_VAL           50
1002
+  #define Y_OVERCURRENT   2000
1003
+  #define Y_STALLCURRENT  1500
1004
+
1005
+  #define Y2_MICROSTEPS     16
1006
+  #define Y2_K_VAL          50
1007
+  #define Y2_OVERCURRENT  2000
1008
+  #define Y2_STALLCURRENT 1500
1009
+
1010
+  #define Z_MICROSTEPS      16
1011
+  #define Z_K_VAL           50
1012
+  #define Z_OVERCURRENT   2000
1013
+  #define Z_STALLCURRENT  1500
1014
+
1015
+  #define Z2_MICROSTEPS     16
1016
+  #define Z2_K_VAL          50
1017
+  #define Z2_OVERCURRENT  2000
1018
+  #define Z2_STALLCURRENT 1500
1019
+
1020
+  #define E0_MICROSTEPS     16
1021
+  #define E0_K_VAL          50
1022
+  #define E0_OVERCURRENT  2000
1023
+  #define E0_STALLCURRENT 1500
1024
+
1025
+  #define E1_MICROSTEPS     16
1026
+  #define E1_K_VAL          50
1027
+  #define E1_OVERCURRENT  2000
1028
+  #define E1_STALLCURRENT 1500
1029
+
1030
+  #define E2_MICROSTEPS     16
1031
+  #define E2_K_VAL          50
1032
+  #define E2_OVERCURRENT  2000
1033
+  #define E2_STALLCURRENT 1500
1034
+
1035
+  #define E3_MICROSTEPS     16
1036
+  #define E3_K_VAL          50
1037
+  #define E3_OVERCURRENT  2000
1038
+  #define E3_STALLCURRENT 1500
828 1039
 
829 1040
 #endif
830 1041
 

+ 304
- 93
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -705,126 +705,337 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
763 761
 
764
-// @section l6470
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
968
+
969
+
970
+/**
971
+ * Enable this section if you have L6470 motor drivers.
972
+ * You need to import the L6470 library into the Arduino IDE for this.
973
+ * (https://github.com/ameyer/Arduino-L6470)
974
+ */
765 975
 
766 976
 //#define HAVE_L6470DRIVER
767 977
 #if ENABLED(HAVE_L6470DRIVER)
768 978
 
769 979
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 980
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 981
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 982
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 983
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 984
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 985
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 986
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 987
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 988
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
989
+
990
+  #define X_MICROSTEPS      16 // number of microsteps
991
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
992
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
993
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
994
+
995
+  #define X2_MICROSTEPS     16
996
+  #define X2_K_VAL          50
997
+  #define X2_OVERCURRENT  2000
998
+  #define X2_STALLCURRENT 1500
999
+
1000
+  #define Y_MICROSTEPS      16
1001
+  #define Y_K_VAL           50
1002
+  #define Y_OVERCURRENT   2000
1003
+  #define Y_STALLCURRENT  1500
1004
+
1005
+  #define Y2_MICROSTEPS     16
1006
+  #define Y2_K_VAL          50
1007
+  #define Y2_OVERCURRENT  2000
1008
+  #define Y2_STALLCURRENT 1500
1009
+
1010
+  #define Z_MICROSTEPS      16
1011
+  #define Z_K_VAL           50
1012
+  #define Z_OVERCURRENT   2000
1013
+  #define Z_STALLCURRENT  1500
1014
+
1015
+  #define Z2_MICROSTEPS     16
1016
+  #define Z2_K_VAL          50
1017
+  #define Z2_OVERCURRENT  2000
1018
+  #define Z2_STALLCURRENT 1500
1019
+
1020
+  #define E0_MICROSTEPS     16
1021
+  #define E0_K_VAL          50
1022
+  #define E0_OVERCURRENT  2000
1023
+  #define E0_STALLCURRENT 1500
1024
+
1025
+  #define E1_MICROSTEPS     16
1026
+  #define E1_K_VAL          50
1027
+  #define E1_OVERCURRENT  2000
1028
+  #define E1_STALLCURRENT 1500
1029
+
1030
+  #define E2_MICROSTEPS     16
1031
+  #define E2_K_VAL          50
1032
+  #define E2_OVERCURRENT  2000
1033
+  #define E2_STALLCURRENT 1500
1034
+
1035
+  #define E3_MICROSTEPS     16
1036
+  #define E3_K_VAL          50
1037
+  #define E3_OVERCURRENT  2000
1038
+  #define E3_STALLCURRENT 1500
828 1039
 
829 1040
 #endif
830 1041
 

+ 304
- 93
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

@@ -713,126 +713,337 @@
713 713
 #if ENABLED(HAVE_TMCDRIVER)
714 714
 
715 715
   //#define X_IS_TMC
716
-  #define X_MAX_CURRENT 1000  //in mA
717
-  #define X_SENSE_RESISTOR 91 //in mOhms
718
-  #define X_MICROSTEPS 16     //number of microsteps
719
-
720 716
   //#define X2_IS_TMC
721
-  #define X2_MAX_CURRENT 1000  //in mA
722
-  #define X2_SENSE_RESISTOR 91 //in mOhms
723
-  #define X2_MICROSTEPS 16     //number of microsteps
724
-
725 717
   //#define Y_IS_TMC
726
-  #define Y_MAX_CURRENT 1000  //in mA
727
-  #define Y_SENSE_RESISTOR 91 //in mOhms
728
-  #define Y_MICROSTEPS 16     //number of microsteps
729
-
730 718
   //#define Y2_IS_TMC
731
-  #define Y2_MAX_CURRENT 1000  //in mA
732
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
733
-  #define Y2_MICROSTEPS 16     //number of microsteps
734
-
735 719
   //#define Z_IS_TMC
736
-  #define Z_MAX_CURRENT 1000  //in mA
737
-  #define Z_SENSE_RESISTOR 91 //in mOhms
738
-  #define Z_MICROSTEPS 16     //number of microsteps
739
-
740 720
   //#define Z2_IS_TMC
741
-  #define Z2_MAX_CURRENT 1000  //in mA
742
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
743
-  #define Z2_MICROSTEPS 16     //number of microsteps
744
-
745 721
   //#define E0_IS_TMC
746
-  #define E0_MAX_CURRENT 1000  //in mA
747
-  #define E0_SENSE_RESISTOR 91 //in mOhms
748
-  #define E0_MICROSTEPS 16     //number of microsteps
749
-
750 722
   //#define E1_IS_TMC
751
-  #define E1_MAX_CURRENT 1000  //in mA
752
-  #define E1_SENSE_RESISTOR 91 //in mOhms
753
-  #define E1_MICROSTEPS 16     //number of microsteps
754
-
755 723
   //#define E2_IS_TMC
756
-  #define E2_MAX_CURRENT 1000  //in mA
757
-  #define E2_SENSE_RESISTOR 91 //in mOhms
758
-  #define E2_MICROSTEPS 16     //number of microsteps
759
-
760 724
   //#define E3_IS_TMC
761
-  #define E3_MAX_CURRENT 1000  //in mA
762
-  #define E3_SENSE_RESISTOR 91 //in mOhms
763
-  #define E3_MICROSTEPS 16     //number of microsteps
725
+
726
+  #define X_MAX_CURRENT     1000 // in mA
727
+  #define X_SENSE_RESISTOR    91 // in mOhms
728
+  #define X_MICROSTEPS        16 // number of microsteps
729
+
730
+  #define X2_MAX_CURRENT    1000
731
+  #define X2_SENSE_RESISTOR   91
732
+  #define X2_MICROSTEPS       16
733
+
734
+  #define Y_MAX_CURRENT     1000
735
+  #define Y_SENSE_RESISTOR    91
736
+  #define Y_MICROSTEPS        16
737
+
738
+  #define Y2_MAX_CURRENT    1000
739
+  #define Y2_SENSE_RESISTOR   91
740
+  #define Y2_MICROSTEPS       16
741
+
742
+  #define Z_MAX_CURRENT     1000
743
+  #define Z_SENSE_RESISTOR    91
744
+  #define Z_MICROSTEPS        16
745
+
746
+  #define Z2_MAX_CURRENT    1000
747
+  #define Z2_SENSE_RESISTOR   91
748
+  #define Z2_MICROSTEPS       16
749
+
750
+  #define E0_MAX_CURRENT    1000
751
+  #define E0_SENSE_RESISTOR   91
752
+  #define E0_MICROSTEPS       16
753
+
754
+  #define E1_MAX_CURRENT    1000
755
+  #define E1_SENSE_RESISTOR   91
756
+  #define E1_MICROSTEPS       16
757
+
758
+  #define E2_MAX_CURRENT    1000
759
+  #define E2_SENSE_RESISTOR   91
760
+  #define E2_MICROSTEPS       16
761
+
762
+  #define E3_MAX_CURRENT    1000
763
+  #define E3_SENSE_RESISTOR   91
764
+  #define E3_MICROSTEPS       16
764 765
 
765 766
 #endif
766 767
 
767
-/******************************************************************************\
768
- * enable this section if you have L6470  motor drivers.
769
- * you need to import the L6470 library into the Arduino IDE for this
770
- ******************************************************************************/
768
+// @section TMC2130
771 769
 
772
-// @section l6470
770
+
771
+/**
772
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
773
+ *
774
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
775
+ * (https://github.com/makertum/Trinamic_TMC2130).
776
+ *
777
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
778
+ * the hardware SPI interface on your board and define the required CS pins
779
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
780
+ */
781
+
782
+//#define HAVE_TMC2130DRIVER
783
+
784
+#if ENABLED(HAVE_TMC2130DRIVER)
785
+
786
+  //#define TMC2130_ADVANCED_CONFIGURATION
787
+
788
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
789
+  //#define X_IS_TMC2130
790
+  //#define X2_IS_TMC2130
791
+  //#define Y_IS_TMC2130
792
+  //#define Y2_IS_TMC2130
793
+  //#define Z_IS_TMC2130
794
+  //#define Z2_IS_TMC2130
795
+  //#define E0_IS_TMC2130
796
+  //#define E1_IS_TMC2130
797
+  //#define E2_IS_TMC2130
798
+  //#define E3_IS_TMC2130
799
+
800
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
801
+
802
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
803
+    // Enabled settings will be automatically applied to all axes specified above.
804
+    //
805
+    // Please read the TMC2130 datasheet:
806
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
807
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
808
+    //
809
+    // The following, uncommented settings are only suggestion.
810
+
811
+    /* GENERAL CONFIGURATION */
812
+
813
+    //#define GLOBAL_EN_PWM_MODE        0
814
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
815
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
816
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
817
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
818
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
819
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
820
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
821
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
822
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
823
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
824
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
825
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
826
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
827
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
828
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
829
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
830
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
831
+
832
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
833
+
834
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
835
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
836
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
837
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
838
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
839
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
840
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
841
+
842
+    /* SPI MODE CONFIGURATION */
843
+
844
+    //#define GLOBAL_XDIRECT            0
845
+
846
+    /* DCSTEP MINIMUM VELOCITY */
847
+
848
+    //#define GLOBAL_VDCMIN             0
849
+
850
+    /* MOTOR DRIVER CONFIGURATION*/
851
+
852
+    //#define GLOBAL_DEDGE              0
853
+    //#define GLOBAL_DISS2G             0
854
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
855
+    #define GLOBAL_MRES              16 // number of microsteps
856
+    #define GLOBAL_SYNC               1 // [0-15]
857
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
858
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
859
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
860
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
861
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
862
+    //#define GLOBAL_RNDTF              0
863
+    //#define GLOBAL_DISFDCC            0
864
+    //#define GLOBAL_FD                 0
865
+    //#define GLOBAL_HEND               0
866
+    //#define GLOBAL_HSTRT              0
867
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
868
+
869
+    //#define GLOBAL_SFILT              0
870
+    //#define GLOBAL_SGT                0
871
+    //#define GLOBAL_SEIMIN             0
872
+    //#define GLOBAL_SEDN               0
873
+    //#define GLOBAL_SEMAX              0
874
+    //#define GLOBAL_SEUP               0
875
+    //#define GLOBAL_SEMIN              0
876
+
877
+    //#define GLOBAL_DC_TIME            0
878
+    //#define GLOBAL_DC_SG              0
879
+
880
+    //#define GLOBAL_FREEWHEEL          0
881
+    //#define GLOBAL_PWM_SYMMETRIC      0
882
+    //#define GLOBAL_PWM_AUTOSCALE      0
883
+    //#define GLOBAL_PWM_FREQ           0
884
+    //#define GLOBAL_PWM_GRAD           0
885
+    //#define GLOBAL_PWM_AMPL           0
886
+
887
+    //#define GLOBAL_ENCM_CTRL          0
888
+
889
+  #else
890
+
891
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
892
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
893
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
894
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
895
+    #define X_MRES           16 // number of microsteps
896
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
897
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
898
+
899
+    #define X2_IHOLD         31
900
+    #define X2_IRUN          31
901
+    #define X2_IHOLDDELAY    15
902
+    #define X2_I_SCALE_ANALOG 1
903
+    #define X2_MRES          16
904
+    #define X2_TBL            1
905
+    #define X2_TOFF           8
906
+
907
+    #define Y_IHOLD          31
908
+    #define Y_IRUN           31
909
+    #define Y_IHOLDDELAY     15
910
+    #define Y_I_SCALE_ANALOG  1
911
+    #define Y_MRES           16
912
+    #define Y_TBL             1
913
+    #define Y_TOFF            8
914
+
915
+    #define Y2_IHOLD         31
916
+    #define Y2_IRUN          31
917
+    #define Y2_IHOLDDELAY    15
918
+    #define Y2_I_SCALE_ANALOG 1
919
+    #define Y2_MRES          16
920
+    #define Y2_TBL            1
921
+    #define Y2_TOFF           8
922
+
923
+    #define Z_IHOLD          31
924
+    #define Z_IRUN           31
925
+    #define Z_IHOLDDELAY     15
926
+    #define Z_I_SCALE_ANALOG  1
927
+    #define Z_MRES           16
928
+    #define Z_TBL             1
929
+    #define Z_TOFF            8
930
+
931
+    #define Z2_IHOLD         31
932
+    #define Z2_IRUN          31
933
+    #define Z2_IHOLDDELAY    15
934
+    #define Z2_I_SCALE_ANALOG 1
935
+    #define Z2_MRES          16
936
+    #define Z2_TBL            1
937
+    #define Z2_TOFF           8
938
+
939
+    #define E0_IHOLD         31
940
+    #define E0_IRUN          31
941
+    #define E0_IHOLDDELAY    15
942
+    #define E0_I_SCALE_ANALOG 1
943
+    #define E0_MRES          16
944
+    #define E0_TBL            1
945
+    #define E0_TOFF           8
946
+
947
+    #define E1_IHOLD         31
948
+    #define E1_IRUN          31
949
+    #define E1_IHOLDDELAY    15
950
+    #define E1_I_SCALE_ANALOG 1
951
+    #define E1_MRES          16
952
+    #define E1_TBL            1
953
+    #define E1_TOFF           8
954
+
955
+    #define E2_IHOLD         31
956
+    #define E2_IRUN          31
957
+    #define E2_IHOLDDELAY    15
958
+    #define E2_I_SCALE_ANALOG 1
959
+    #define E2_MRES          16
960
+    #define E2_TBL            1
961
+    #define E2_TOFF           8
962
+
963
+    #define E3_IHOLD         31
964
+    #define E3_IRUN          31
965
+    #define E3_IHOLDDELAY    15
966
+    #define E3_I_SCALE_ANALOG 1
967
+    #define E3_MRES          16
968
+    #define E3_TBL            1
969
+    #define E3_TOFF           8
970
+
971
+  #endif // TMC2130_ADVANCED_CONFIGURATION
972
+
973
+#endif // HAVE_TMC2130DRIVER
974
+
975
+// @section L6470
976
+
977
+
978
+/**
979
+ * Enable this section if you have L6470 motor drivers.
980
+ * You need to import the L6470 library into the Arduino IDE for this.
981
+ * (https://github.com/ameyer/Arduino-L6470)
982
+ */
773 983
 
774 984
 //#define HAVE_L6470DRIVER
775 985
 #if ENABLED(HAVE_L6470DRIVER)
776 986
 
777 987
   //#define X_IS_L6470
778
-  #define X_MICROSTEPS 16     //number of microsteps
779
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
780
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
781
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
782
-
783 988
   //#define X2_IS_L6470
784
-  #define X2_MICROSTEPS 16     //number of microsteps
785
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
786
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
787
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
788
-
789 989
   //#define Y_IS_L6470
790
-  #define Y_MICROSTEPS 16     //number of microsteps
791
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
792
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
793
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
794
-
795 990
   //#define Y2_IS_L6470
796
-  #define Y2_MICROSTEPS 16     //number of microsteps
797
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
798
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
799
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
800
-
801 991
   //#define Z_IS_L6470
802
-  #define Z_MICROSTEPS 16     //number of microsteps
803
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
804
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
805
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
806
-
807 992
   //#define Z2_IS_L6470
808
-  #define Z2_MICROSTEPS 16     //number of microsteps
809
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
810
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
811
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
812
-
813 993
   //#define E0_IS_L6470
814
-  #define E0_MICROSTEPS 16     //number of microsteps
815
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
816
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
817
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
818
-
819 994
   //#define E1_IS_L6470
820
-  #define E1_MICROSTEPS 16     //number of microsteps
821
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
822
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
823
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
824
-
825 995
   //#define E2_IS_L6470
826
-  #define E2_MICROSTEPS 16     //number of microsteps
827
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
828
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
829
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
830
-
831 996
   //#define E3_IS_L6470
832
-  #define E3_MICROSTEPS 16     //number of microsteps
833
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
834
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
835
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
997
+
998
+  #define X_MICROSTEPS      16 // number of microsteps
999
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
1000
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
1001
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
1002
+
1003
+  #define X2_MICROSTEPS     16
1004
+  #define X2_K_VAL          50
1005
+  #define X2_OVERCURRENT  2000
1006
+  #define X2_STALLCURRENT 1500
1007
+
1008
+  #define Y_MICROSTEPS      16
1009
+  #define Y_K_VAL           50
1010
+  #define Y_OVERCURRENT   2000
1011
+  #define Y_STALLCURRENT  1500
1012
+
1013
+  #define Y2_MICROSTEPS     16
1014
+  #define Y2_K_VAL          50
1015
+  #define Y2_OVERCURRENT  2000
1016
+  #define Y2_STALLCURRENT 1500
1017
+
1018
+  #define Z_MICROSTEPS      16
1019
+  #define Z_K_VAL           50
1020
+  #define Z_OVERCURRENT   2000
1021
+  #define Z_STALLCURRENT  1500
1022
+
1023
+  #define Z2_MICROSTEPS     16
1024
+  #define Z2_K_VAL          50
1025
+  #define Z2_OVERCURRENT  2000
1026
+  #define Z2_STALLCURRENT 1500
1027
+
1028
+  #define E0_MICROSTEPS     16
1029
+  #define E0_K_VAL          50
1030
+  #define E0_OVERCURRENT  2000
1031
+  #define E0_STALLCURRENT 1500
1032
+
1033
+  #define E1_MICROSTEPS     16
1034
+  #define E1_K_VAL          50
1035
+  #define E1_OVERCURRENT  2000
1036
+  #define E1_STALLCURRENT 1500
1037
+
1038
+  #define E2_MICROSTEPS     16
1039
+  #define E2_K_VAL          50
1040
+  #define E2_OVERCURRENT  2000
1041
+  #define E2_STALLCURRENT 1500
1042
+
1043
+  #define E3_MICROSTEPS     16
1044
+  #define E3_K_VAL          50
1045
+  #define E3_OVERCURRENT  2000
1046
+  #define E3_STALLCURRENT 1500
836 1047
 
837 1048
 #endif
838 1049
 

+ 303
- 93
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -705,126 +705,336 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
761
+
762
+/**
763
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
764
+ *
765
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
766
+ * (https://github.com/makertum/Trinamic_TMC2130).
767
+ *
768
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
769
+ * the hardware SPI interface on your board and define the required CS pins
770
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
771
+ */
772
+
773
+//#define HAVE_TMC2130DRIVER
774
+
775
+#if ENABLED(HAVE_TMC2130DRIVER)
776
+
777
+  //#define TMC2130_ADVANCED_CONFIGURATION
778
+
779
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
780
+  //#define X_IS_TMC2130
781
+  //#define X2_IS_TMC2130
782
+  //#define Y_IS_TMC2130
783
+  //#define Y2_IS_TMC2130
784
+  //#define Z_IS_TMC2130
785
+  //#define Z2_IS_TMC2130
786
+  //#define E0_IS_TMC2130
787
+  //#define E1_IS_TMC2130
788
+  //#define E2_IS_TMC2130
789
+  //#define E3_IS_TMC2130
790
+
791
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
792
+
793
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
794
+    // Enabled settings will be automatically applied to all axes specified above.
795
+    //
796
+    // Please read the TMC2130 datasheet:
797
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
798
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
799
+    //
800
+    // The following, uncommented settings are only suggestion.
801
+
802
+    /* GENERAL CONFIGURATION */
803
+
804
+    //#define GLOBAL_EN_PWM_MODE        0
805
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
806
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
807
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
808
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
809
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
810
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
811
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
812
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
813
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
818
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
820
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
821
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
822
+
823
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
824
+
825
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
826
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
828
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
829
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
830
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+
833
+    /* SPI MODE CONFIGURATION */
834
+
835
+    //#define GLOBAL_XDIRECT            0
836
+
837
+    /* DCSTEP MINIMUM VELOCITY */
838
+
839
+    //#define GLOBAL_VDCMIN             0
840
+
841
+    /* MOTOR DRIVER CONFIGURATION*/
842
+
843
+    //#define GLOBAL_DEDGE              0
844
+    //#define GLOBAL_DISS2G             0
845
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
846
+    #define GLOBAL_MRES              16 // number of microsteps
847
+    #define GLOBAL_SYNC               1 // [0-15]
848
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
849
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
850
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
851
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
852
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
853
+    //#define GLOBAL_RNDTF              0
854
+    //#define GLOBAL_DISFDCC            0
855
+    //#define GLOBAL_FD                 0
856
+    //#define GLOBAL_HEND               0
857
+    //#define GLOBAL_HSTRT              0
858
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
859
+
860
+    //#define GLOBAL_SFILT              0
861
+    //#define GLOBAL_SGT                0
862
+    //#define GLOBAL_SEIMIN             0
863
+    //#define GLOBAL_SEDN               0
864
+    //#define GLOBAL_SEMAX              0
865
+    //#define GLOBAL_SEUP               0
866
+    //#define GLOBAL_SEMIN              0
867
+
868
+    //#define GLOBAL_DC_TIME            0
869
+    //#define GLOBAL_DC_SG              0
870
+
871
+    //#define GLOBAL_FREEWHEEL          0
872
+    //#define GLOBAL_PWM_SYMMETRIC      0
873
+    //#define GLOBAL_PWM_AUTOSCALE      0
874
+    //#define GLOBAL_PWM_FREQ           0
875
+    //#define GLOBAL_PWM_GRAD           0
876
+    //#define GLOBAL_PWM_AMPL           0
877
+
878
+    //#define GLOBAL_ENCM_CTRL          0
879
+
880
+  #else
881
+
882
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
883
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
884
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
885
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
886
+    #define X_MRES           16 // number of microsteps
887
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
888
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
889
+
890
+    #define X2_IHOLD         31
891
+    #define X2_IRUN          31
892
+    #define X2_IHOLDDELAY    15
893
+    #define X2_I_SCALE_ANALOG 1
894
+    #define X2_MRES          16
895
+    #define X2_TBL            1
896
+    #define X2_TOFF           8
897
+
898
+    #define Y_IHOLD          31
899
+    #define Y_IRUN           31
900
+    #define Y_IHOLDDELAY     15
901
+    #define Y_I_SCALE_ANALOG  1
902
+    #define Y_MRES           16
903
+    #define Y_TBL             1
904
+    #define Y_TOFF            8
905
+
906
+    #define Y2_IHOLD         31
907
+    #define Y2_IRUN          31
908
+    #define Y2_IHOLDDELAY    15
909
+    #define Y2_I_SCALE_ANALOG 1
910
+    #define Y2_MRES          16
911
+    #define Y2_TBL            1
912
+    #define Y2_TOFF           8
913
+
914
+    #define Z_IHOLD          31
915
+    #define Z_IRUN           31
916
+    #define Z_IHOLDDELAY     15
917
+    #define Z_I_SCALE_ANALOG  1
918
+    #define Z_MRES           16
919
+    #define Z_TBL             1
920
+    #define Z_TOFF            8
921
+
922
+    #define Z2_IHOLD         31
923
+    #define Z2_IRUN          31
924
+    #define Z2_IHOLDDELAY    15
925
+    #define Z2_I_SCALE_ANALOG 1
926
+    #define Z2_MRES          16
927
+    #define Z2_TBL            1
928
+    #define Z2_TOFF           8
929
+
930
+    #define E0_IHOLD         31
931
+    #define E0_IRUN          31
932
+    #define E0_IHOLDDELAY    15
933
+    #define E0_I_SCALE_ANALOG 1
934
+    #define E0_MRES          16
935
+    #define E0_TBL            1
936
+    #define E0_TOFF           8
937
+
938
+    #define E1_IHOLD         31
939
+    #define E1_IRUN          31
940
+    #define E1_IHOLDDELAY    15
941
+    #define E1_I_SCALE_ANALOG 1
942
+    #define E1_MRES          16
943
+    #define E1_TBL            1
944
+    #define E1_TOFF           8
945
+
946
+    #define E2_IHOLD         31
947
+    #define E2_IRUN          31
948
+    #define E2_IHOLDDELAY    15
949
+    #define E2_I_SCALE_ANALOG 1
950
+    #define E2_MRES          16
951
+    #define E2_TBL            1
952
+    #define E2_TOFF           8
953
+
954
+    #define E3_IHOLD         31
955
+    #define E3_IRUN          31
956
+    #define E3_IHOLDDELAY    15
957
+    #define E3_I_SCALE_ANALOG 1
958
+    #define E3_MRES          16
959
+    #define E3_TBL            1
960
+    #define E3_TOFF           8
961
+
962
+  #endif // TMC2130_ADVANCED_CONFIGURATION
963
+
964
+#endif // HAVE_TMC2130DRIVER
965
+
966
+// @section L6470
967
+
763 968
 
764
-// @section l6470
969
+/**
970
+ * Enable this section if you have L6470 motor drivers.
971
+ * You need to import the L6470 library into the Arduino IDE for this.
972
+ * (https://github.com/ameyer/Arduino-L6470)
973
+ */
765 974
 
766 975
 //#define HAVE_L6470DRIVER
767 976
 #if ENABLED(HAVE_L6470DRIVER)
768 977
 
769 978
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 979
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 980
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 981
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 982
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 983
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 984
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 985
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 986
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 987
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
988
+
989
+  #define X_MICROSTEPS      16 // number of microsteps
990
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
991
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
992
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
993
+
994
+  #define X2_MICROSTEPS     16
995
+  #define X2_K_VAL          50
996
+  #define X2_OVERCURRENT  2000
997
+  #define X2_STALLCURRENT 1500
998
+
999
+  #define Y_MICROSTEPS      16
1000
+  #define Y_K_VAL           50
1001
+  #define Y_OVERCURRENT   2000
1002
+  #define Y_STALLCURRENT  1500
1003
+
1004
+  #define Y2_MICROSTEPS     16
1005
+  #define Y2_K_VAL          50
1006
+  #define Y2_OVERCURRENT  2000
1007
+  #define Y2_STALLCURRENT 1500
1008
+
1009
+  #define Z_MICROSTEPS      16
1010
+  #define Z_K_VAL           50
1011
+  #define Z_OVERCURRENT   2000
1012
+  #define Z_STALLCURRENT  1500
1013
+
1014
+  #define Z2_MICROSTEPS     16
1015
+  #define Z2_K_VAL          50
1016
+  #define Z2_OVERCURRENT  2000
1017
+  #define Z2_STALLCURRENT 1500
1018
+
1019
+  #define E0_MICROSTEPS     16
1020
+  #define E0_K_VAL          50
1021
+  #define E0_OVERCURRENT  2000
1022
+  #define E0_STALLCURRENT 1500
1023
+
1024
+  #define E1_MICROSTEPS     16
1025
+  #define E1_K_VAL          50
1026
+  #define E1_OVERCURRENT  2000
1027
+  #define E1_STALLCURRENT 1500
1028
+
1029
+  #define E2_MICROSTEPS     16
1030
+  #define E2_K_VAL          50
1031
+  #define E2_OVERCURRENT  2000
1032
+  #define E2_STALLCURRENT 1500
1033
+
1034
+  #define E3_MICROSTEPS     16
1035
+  #define E3_K_VAL          50
1036
+  #define E3_OVERCURRENT  2000
1037
+  #define E3_STALLCURRENT 1500
828 1038
 
829 1039
 #endif
830 1040
 

+ 304
- 93
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h View File

@@ -707,126 +707,337 @@
707 707
 #if ENABLED(HAVE_TMCDRIVER)
708 708
 
709 709
   //#define X_IS_TMC
710
-  #define X_MAX_CURRENT 1000  //in mA
711
-  #define X_SENSE_RESISTOR 91 //in mOhms
712
-  #define X_MICROSTEPS 16     //number of microsteps
713
-
714 710
   //#define X2_IS_TMC
715
-  #define X2_MAX_CURRENT 1000  //in mA
716
-  #define X2_SENSE_RESISTOR 91 //in mOhms
717
-  #define X2_MICROSTEPS 16     //number of microsteps
718
-
719 711
   //#define Y_IS_TMC
720
-  #define Y_MAX_CURRENT 1000  //in mA
721
-  #define Y_SENSE_RESISTOR 91 //in mOhms
722
-  #define Y_MICROSTEPS 16     //number of microsteps
723
-
724 712
   //#define Y2_IS_TMC
725
-  #define Y2_MAX_CURRENT 1000  //in mA
726
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
727
-  #define Y2_MICROSTEPS 16     //number of microsteps
728
-
729 713
   //#define Z_IS_TMC
730
-  #define Z_MAX_CURRENT 1000  //in mA
731
-  #define Z_SENSE_RESISTOR 91 //in mOhms
732
-  #define Z_MICROSTEPS 16     //number of microsteps
733
-
734 714
   //#define Z2_IS_TMC
735
-  #define Z2_MAX_CURRENT 1000  //in mA
736
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
737
-  #define Z2_MICROSTEPS 16     //number of microsteps
738
-
739 715
   //#define E0_IS_TMC
740
-  #define E0_MAX_CURRENT 1000  //in mA
741
-  #define E0_SENSE_RESISTOR 91 //in mOhms
742
-  #define E0_MICROSTEPS 16     //number of microsteps
743
-
744 716
   //#define E1_IS_TMC
745
-  #define E1_MAX_CURRENT 1000  //in mA
746
-  #define E1_SENSE_RESISTOR 91 //in mOhms
747
-  #define E1_MICROSTEPS 16     //number of microsteps
748
-
749 717
   //#define E2_IS_TMC
750
-  #define E2_MAX_CURRENT 1000  //in mA
751
-  #define E2_SENSE_RESISTOR 91 //in mOhms
752
-  #define E2_MICROSTEPS 16     //number of microsteps
753
-
754 718
   //#define E3_IS_TMC
755
-  #define E3_MAX_CURRENT 1000  //in mA
756
-  #define E3_SENSE_RESISTOR 91 //in mOhms
757
-  #define E3_MICROSTEPS 16     //number of microsteps
719
+
720
+  #define X_MAX_CURRENT     1000 // in mA
721
+  #define X_SENSE_RESISTOR    91 // in mOhms
722
+  #define X_MICROSTEPS        16 // number of microsteps
723
+
724
+  #define X2_MAX_CURRENT    1000
725
+  #define X2_SENSE_RESISTOR   91
726
+  #define X2_MICROSTEPS       16
727
+
728
+  #define Y_MAX_CURRENT     1000
729
+  #define Y_SENSE_RESISTOR    91
730
+  #define Y_MICROSTEPS        16
731
+
732
+  #define Y2_MAX_CURRENT    1000
733
+  #define Y2_SENSE_RESISTOR   91
734
+  #define Y2_MICROSTEPS       16
735
+
736
+  #define Z_MAX_CURRENT     1000
737
+  #define Z_SENSE_RESISTOR    91
738
+  #define Z_MICROSTEPS        16
739
+
740
+  #define Z2_MAX_CURRENT    1000
741
+  #define Z2_SENSE_RESISTOR   91
742
+  #define Z2_MICROSTEPS       16
743
+
744
+  #define E0_MAX_CURRENT    1000
745
+  #define E0_SENSE_RESISTOR   91
746
+  #define E0_MICROSTEPS       16
747
+
748
+  #define E1_MAX_CURRENT    1000
749
+  #define E1_SENSE_RESISTOR   91
750
+  #define E1_MICROSTEPS       16
751
+
752
+  #define E2_MAX_CURRENT    1000
753
+  #define E2_SENSE_RESISTOR   91
754
+  #define E2_MICROSTEPS       16
755
+
756
+  #define E3_MAX_CURRENT    1000
757
+  #define E3_SENSE_RESISTOR   91
758
+  #define E3_MICROSTEPS       16
758 759
 
759 760
 #endif
760 761
 
761
-/******************************************************************************\
762
- * enable this section if you have L6470  motor drivers.
763
- * you need to import the L6470 library into the Arduino IDE for this
764
- ******************************************************************************/
762
+// @section TMC2130
765 763
 
766
-// @section l6470
764
+
765
+/**
766
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
767
+ *
768
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
769
+ * (https://github.com/makertum/Trinamic_TMC2130).
770
+ *
771
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
772
+ * the hardware SPI interface on your board and define the required CS pins
773
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
774
+ */
775
+
776
+//#define HAVE_TMC2130DRIVER
777
+
778
+#if ENABLED(HAVE_TMC2130DRIVER)
779
+
780
+  //#define TMC2130_ADVANCED_CONFIGURATION
781
+
782
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
783
+  //#define X_IS_TMC2130
784
+  //#define X2_IS_TMC2130
785
+  //#define Y_IS_TMC2130
786
+  //#define Y2_IS_TMC2130
787
+  //#define Z_IS_TMC2130
788
+  //#define Z2_IS_TMC2130
789
+  //#define E0_IS_TMC2130
790
+  //#define E1_IS_TMC2130
791
+  //#define E2_IS_TMC2130
792
+  //#define E3_IS_TMC2130
793
+
794
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
795
+
796
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
797
+    // Enabled settings will be automatically applied to all axes specified above.
798
+    //
799
+    // Please read the TMC2130 datasheet:
800
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
801
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
802
+    //
803
+    // The following, uncommented settings are only suggestion.
804
+
805
+    /* GENERAL CONFIGURATION */
806
+
807
+    //#define GLOBAL_EN_PWM_MODE        0
808
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
809
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
810
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
811
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
812
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
813
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
814
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
815
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
817
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
818
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
819
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
820
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
821
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
822
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
823
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
824
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
825
+
826
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
827
+
828
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
829
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
830
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
831
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
832
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
834
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
835
+
836
+    /* SPI MODE CONFIGURATION */
837
+
838
+    //#define GLOBAL_XDIRECT            0
839
+
840
+    /* DCSTEP MINIMUM VELOCITY */
841
+
842
+    //#define GLOBAL_VDCMIN             0
843
+
844
+    /* MOTOR DRIVER CONFIGURATION*/
845
+
846
+    //#define GLOBAL_DEDGE              0
847
+    //#define GLOBAL_DISS2G             0
848
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
849
+    #define GLOBAL_MRES              16 // number of microsteps
850
+    #define GLOBAL_SYNC               1 // [0-15]
851
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
852
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
853
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
854
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
855
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
856
+    //#define GLOBAL_RNDTF              0
857
+    //#define GLOBAL_DISFDCC            0
858
+    //#define GLOBAL_FD                 0
859
+    //#define GLOBAL_HEND               0
860
+    //#define GLOBAL_HSTRT              0
861
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
862
+
863
+    //#define GLOBAL_SFILT              0
864
+    //#define GLOBAL_SGT                0
865
+    //#define GLOBAL_SEIMIN             0
866
+    //#define GLOBAL_SEDN               0
867
+    //#define GLOBAL_SEMAX              0
868
+    //#define GLOBAL_SEUP               0
869
+    //#define GLOBAL_SEMIN              0
870
+
871
+    //#define GLOBAL_DC_TIME            0
872
+    //#define GLOBAL_DC_SG              0
873
+
874
+    //#define GLOBAL_FREEWHEEL          0
875
+    //#define GLOBAL_PWM_SYMMETRIC      0
876
+    //#define GLOBAL_PWM_AUTOSCALE      0
877
+    //#define GLOBAL_PWM_FREQ           0
878
+    //#define GLOBAL_PWM_GRAD           0
879
+    //#define GLOBAL_PWM_AMPL           0
880
+
881
+    //#define GLOBAL_ENCM_CTRL          0
882
+
883
+  #else
884
+
885
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
886
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
887
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
888
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
889
+    #define X_MRES           16 // number of microsteps
890
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
891
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
892
+
893
+    #define X2_IHOLD         31
894
+    #define X2_IRUN          31
895
+    #define X2_IHOLDDELAY    15
896
+    #define X2_I_SCALE_ANALOG 1
897
+    #define X2_MRES          16
898
+    #define X2_TBL            1
899
+    #define X2_TOFF           8
900
+
901
+    #define Y_IHOLD          31
902
+    #define Y_IRUN           31
903
+    #define Y_IHOLDDELAY     15
904
+    #define Y_I_SCALE_ANALOG  1
905
+    #define Y_MRES           16
906
+    #define Y_TBL             1
907
+    #define Y_TOFF            8
908
+
909
+    #define Y2_IHOLD         31
910
+    #define Y2_IRUN          31
911
+    #define Y2_IHOLDDELAY    15
912
+    #define Y2_I_SCALE_ANALOG 1
913
+    #define Y2_MRES          16
914
+    #define Y2_TBL            1
915
+    #define Y2_TOFF           8
916
+
917
+    #define Z_IHOLD          31
918
+    #define Z_IRUN           31
919
+    #define Z_IHOLDDELAY     15
920
+    #define Z_I_SCALE_ANALOG  1
921
+    #define Z_MRES           16
922
+    #define Z_TBL             1
923
+    #define Z_TOFF            8
924
+
925
+    #define Z2_IHOLD         31
926
+    #define Z2_IRUN          31
927
+    #define Z2_IHOLDDELAY    15
928
+    #define Z2_I_SCALE_ANALOG 1
929
+    #define Z2_MRES          16
930
+    #define Z2_TBL            1
931
+    #define Z2_TOFF           8
932
+
933
+    #define E0_IHOLD         31
934
+    #define E0_IRUN          31
935
+    #define E0_IHOLDDELAY    15
936
+    #define E0_I_SCALE_ANALOG 1
937
+    #define E0_MRES          16
938
+    #define E0_TBL            1
939
+    #define E0_TOFF           8
940
+
941
+    #define E1_IHOLD         31
942
+    #define E1_IRUN          31
943
+    #define E1_IHOLDDELAY    15
944
+    #define E1_I_SCALE_ANALOG 1
945
+    #define E1_MRES          16
946
+    #define E1_TBL            1
947
+    #define E1_TOFF           8
948
+
949
+    #define E2_IHOLD         31
950
+    #define E2_IRUN          31
951
+    #define E2_IHOLDDELAY    15
952
+    #define E2_I_SCALE_ANALOG 1
953
+    #define E2_MRES          16
954
+    #define E2_TBL            1
955
+    #define E2_TOFF           8
956
+
957
+    #define E3_IHOLD         31
958
+    #define E3_IRUN          31
959
+    #define E3_IHOLDDELAY    15
960
+    #define E3_I_SCALE_ANALOG 1
961
+    #define E3_MRES          16
962
+    #define E3_TBL            1
963
+    #define E3_TOFF           8
964
+
965
+  #endif // TMC2130_ADVANCED_CONFIGURATION
966
+
967
+#endif // HAVE_TMC2130DRIVER
968
+
969
+// @section L6470
970
+
971
+
972
+/**
973
+ * Enable this section if you have L6470 motor drivers.
974
+ * You need to import the L6470 library into the Arduino IDE for this.
975
+ * (https://github.com/ameyer/Arduino-L6470)
976
+ */
767 977
 
768 978
 //#define HAVE_L6470DRIVER
769 979
 #if ENABLED(HAVE_L6470DRIVER)
770 980
 
771 981
   //#define X_IS_L6470
772
-  #define X_MICROSTEPS 16     //number of microsteps
773
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
774
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
775
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
776
-
777 982
   //#define X2_IS_L6470
778
-  #define X2_MICROSTEPS 16     //number of microsteps
779
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
780
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
781
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
782
-
783 983
   //#define Y_IS_L6470
784
-  #define Y_MICROSTEPS 16     //number of microsteps
785
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
786
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
787
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
788
-
789 984
   //#define Y2_IS_L6470
790
-  #define Y2_MICROSTEPS 16     //number of microsteps
791
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
792
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
793
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
794
-
795 985
   //#define Z_IS_L6470
796
-  #define Z_MICROSTEPS 16     //number of microsteps
797
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
798
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
799
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
800
-
801 986
   //#define Z2_IS_L6470
802
-  #define Z2_MICROSTEPS 16     //number of microsteps
803
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
804
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
805
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
806
-
807 987
   //#define E0_IS_L6470
808
-  #define E0_MICROSTEPS 16     //number of microsteps
809
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
810
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
811
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
812
-
813 988
   //#define E1_IS_L6470
814
-  #define E1_MICROSTEPS 16     //number of microsteps
815
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
816
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
817
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
818
-
819 989
   //#define E2_IS_L6470
820
-  #define E2_MICROSTEPS 16     //number of microsteps
821
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
822
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
823
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
824
-
825 990
   //#define E3_IS_L6470
826
-  #define E3_MICROSTEPS 16     //number of microsteps
827
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
828
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
829
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
991
+
992
+  #define X_MICROSTEPS      16 // number of microsteps
993
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
994
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
995
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
996
+
997
+  #define X2_MICROSTEPS     16
998
+  #define X2_K_VAL          50
999
+  #define X2_OVERCURRENT  2000
1000
+  #define X2_STALLCURRENT 1500
1001
+
1002
+  #define Y_MICROSTEPS      16
1003
+  #define Y_K_VAL           50
1004
+  #define Y_OVERCURRENT   2000
1005
+  #define Y_STALLCURRENT  1500
1006
+
1007
+  #define Y2_MICROSTEPS     16
1008
+  #define Y2_K_VAL          50
1009
+  #define Y2_OVERCURRENT  2000
1010
+  #define Y2_STALLCURRENT 1500
1011
+
1012
+  #define Z_MICROSTEPS      16
1013
+  #define Z_K_VAL           50
1014
+  #define Z_OVERCURRENT   2000
1015
+  #define Z_STALLCURRENT  1500
1016
+
1017
+  #define Z2_MICROSTEPS     16
1018
+  #define Z2_K_VAL          50
1019
+  #define Z2_OVERCURRENT  2000
1020
+  #define Z2_STALLCURRENT 1500
1021
+
1022
+  #define E0_MICROSTEPS     16
1023
+  #define E0_K_VAL          50
1024
+  #define E0_OVERCURRENT  2000
1025
+  #define E0_STALLCURRENT 1500
1026
+
1027
+  #define E1_MICROSTEPS     16
1028
+  #define E1_K_VAL          50
1029
+  #define E1_OVERCURRENT  2000
1030
+  #define E1_STALLCURRENT 1500
1031
+
1032
+  #define E2_MICROSTEPS     16
1033
+  #define E2_K_VAL          50
1034
+  #define E2_OVERCURRENT  2000
1035
+  #define E2_STALLCURRENT 1500
1036
+
1037
+  #define E3_MICROSTEPS     16
1038
+  #define E3_K_VAL          50
1039
+  #define E3_OVERCURRENT  2000
1040
+  #define E3_STALLCURRENT 1500
830 1041
 
831 1042
 #endif
832 1043
 

+ 304
- 93
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -707,126 +707,337 @@
707 707
 #if ENABLED(HAVE_TMCDRIVER)
708 708
 
709 709
   //#define X_IS_TMC
710
-  #define X_MAX_CURRENT 1000  //in mA
711
-  #define X_SENSE_RESISTOR 91 //in mOhms
712
-  #define X_MICROSTEPS 16     //number of microsteps
713
-
714 710
   //#define X2_IS_TMC
715
-  #define X2_MAX_CURRENT 1000  //in mA
716
-  #define X2_SENSE_RESISTOR 91 //in mOhms
717
-  #define X2_MICROSTEPS 16     //number of microsteps
718
-
719 711
   //#define Y_IS_TMC
720
-  #define Y_MAX_CURRENT 1000  //in mA
721
-  #define Y_SENSE_RESISTOR 91 //in mOhms
722
-  #define Y_MICROSTEPS 16     //number of microsteps
723
-
724 712
   //#define Y2_IS_TMC
725
-  #define Y2_MAX_CURRENT 1000  //in mA
726
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
727
-  #define Y2_MICROSTEPS 16     //number of microsteps
728
-
729 713
   //#define Z_IS_TMC
730
-  #define Z_MAX_CURRENT 1000  //in mA
731
-  #define Z_SENSE_RESISTOR 91 //in mOhms
732
-  #define Z_MICROSTEPS 16     //number of microsteps
733
-
734 714
   //#define Z2_IS_TMC
735
-  #define Z2_MAX_CURRENT 1000  //in mA
736
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
737
-  #define Z2_MICROSTEPS 16     //number of microsteps
738
-
739 715
   //#define E0_IS_TMC
740
-  #define E0_MAX_CURRENT 1000  //in mA
741
-  #define E0_SENSE_RESISTOR 91 //in mOhms
742
-  #define E0_MICROSTEPS 16     //number of microsteps
743
-
744 716
   //#define E1_IS_TMC
745
-  #define E1_MAX_CURRENT 1000  //in mA
746
-  #define E1_SENSE_RESISTOR 91 //in mOhms
747
-  #define E1_MICROSTEPS 16     //number of microsteps
748
-
749 717
   //#define E2_IS_TMC
750
-  #define E2_MAX_CURRENT 1000  //in mA
751
-  #define E2_SENSE_RESISTOR 91 //in mOhms
752
-  #define E2_MICROSTEPS 16     //number of microsteps
753
-
754 718
   //#define E3_IS_TMC
755
-  #define E3_MAX_CURRENT 1000  //in mA
756
-  #define E3_SENSE_RESISTOR 91 //in mOhms
757
-  #define E3_MICROSTEPS 16     //number of microsteps
719
+
720
+  #define X_MAX_CURRENT     1000 // in mA
721
+  #define X_SENSE_RESISTOR    91 // in mOhms
722
+  #define X_MICROSTEPS        16 // number of microsteps
723
+
724
+  #define X2_MAX_CURRENT    1000
725
+  #define X2_SENSE_RESISTOR   91
726
+  #define X2_MICROSTEPS       16
727
+
728
+  #define Y_MAX_CURRENT     1000
729
+  #define Y_SENSE_RESISTOR    91
730
+  #define Y_MICROSTEPS        16
731
+
732
+  #define Y2_MAX_CURRENT    1000
733
+  #define Y2_SENSE_RESISTOR   91
734
+  #define Y2_MICROSTEPS       16
735
+
736
+  #define Z_MAX_CURRENT     1000
737
+  #define Z_SENSE_RESISTOR    91
738
+  #define Z_MICROSTEPS        16
739
+
740
+  #define Z2_MAX_CURRENT    1000
741
+  #define Z2_SENSE_RESISTOR   91
742
+  #define Z2_MICROSTEPS       16
743
+
744
+  #define E0_MAX_CURRENT    1000
745
+  #define E0_SENSE_RESISTOR   91
746
+  #define E0_MICROSTEPS       16
747
+
748
+  #define E1_MAX_CURRENT    1000
749
+  #define E1_SENSE_RESISTOR   91
750
+  #define E1_MICROSTEPS       16
751
+
752
+  #define E2_MAX_CURRENT    1000
753
+  #define E2_SENSE_RESISTOR   91
754
+  #define E2_MICROSTEPS       16
755
+
756
+  #define E3_MAX_CURRENT    1000
757
+  #define E3_SENSE_RESISTOR   91
758
+  #define E3_MICROSTEPS       16
758 759
 
759 760
 #endif
760 761
 
761
-/******************************************************************************\
762
- * enable this section if you have L6470  motor drivers.
763
- * you need to import the L6470 library into the Arduino IDE for this
764
- ******************************************************************************/
762
+// @section TMC2130
765 763
 
766
-// @section l6470
764
+
765
+/**
766
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
767
+ *
768
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
769
+ * (https://github.com/makertum/Trinamic_TMC2130).
770
+ *
771
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
772
+ * the hardware SPI interface on your board and define the required CS pins
773
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
774
+ */
775
+
776
+//#define HAVE_TMC2130DRIVER
777
+
778
+#if ENABLED(HAVE_TMC2130DRIVER)
779
+
780
+  //#define TMC2130_ADVANCED_CONFIGURATION
781
+
782
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
783
+  //#define X_IS_TMC2130
784
+  //#define X2_IS_TMC2130
785
+  //#define Y_IS_TMC2130
786
+  //#define Y2_IS_TMC2130
787
+  //#define Z_IS_TMC2130
788
+  //#define Z2_IS_TMC2130
789
+  //#define E0_IS_TMC2130
790
+  //#define E1_IS_TMC2130
791
+  //#define E2_IS_TMC2130
792
+  //#define E3_IS_TMC2130
793
+
794
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
795
+
796
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
797
+    // Enabled settings will be automatically applied to all axes specified above.
798
+    //
799
+    // Please read the TMC2130 datasheet:
800
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
801
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
802
+    //
803
+    // The following, uncommented settings are only suggestion.
804
+
805
+    /* GENERAL CONFIGURATION */
806
+
807
+    //#define GLOBAL_EN_PWM_MODE        0
808
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
809
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
810
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
811
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
812
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
813
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
814
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
815
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
817
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
818
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
819
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
820
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
821
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
822
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
823
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
824
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
825
+
826
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
827
+
828
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
829
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
830
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
831
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
832
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
834
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
835
+
836
+    /* SPI MODE CONFIGURATION */
837
+
838
+    //#define GLOBAL_XDIRECT            0
839
+
840
+    /* DCSTEP MINIMUM VELOCITY */
841
+
842
+    //#define GLOBAL_VDCMIN             0
843
+
844
+    /* MOTOR DRIVER CONFIGURATION*/
845
+
846
+    //#define GLOBAL_DEDGE              0
847
+    //#define GLOBAL_DISS2G             0
848
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
849
+    #define GLOBAL_MRES              16 // number of microsteps
850
+    #define GLOBAL_SYNC               1 // [0-15]
851
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
852
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
853
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
854
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
855
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
856
+    //#define GLOBAL_RNDTF              0
857
+    //#define GLOBAL_DISFDCC            0
858
+    //#define GLOBAL_FD                 0
859
+    //#define GLOBAL_HEND               0
860
+    //#define GLOBAL_HSTRT              0
861
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
862
+
863
+    //#define GLOBAL_SFILT              0
864
+    //#define GLOBAL_SGT                0
865
+    //#define GLOBAL_SEIMIN             0
866
+    //#define GLOBAL_SEDN               0
867
+    //#define GLOBAL_SEMAX              0
868
+    //#define GLOBAL_SEUP               0
869
+    //#define GLOBAL_SEMIN              0
870
+
871
+    //#define GLOBAL_DC_TIME            0
872
+    //#define GLOBAL_DC_SG              0
873
+
874
+    //#define GLOBAL_FREEWHEEL          0
875
+    //#define GLOBAL_PWM_SYMMETRIC      0
876
+    //#define GLOBAL_PWM_AUTOSCALE      0
877
+    //#define GLOBAL_PWM_FREQ           0
878
+    //#define GLOBAL_PWM_GRAD           0
879
+    //#define GLOBAL_PWM_AMPL           0
880
+
881
+    //#define GLOBAL_ENCM_CTRL          0
882
+
883
+  #else
884
+
885
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
886
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
887
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
888
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
889
+    #define X_MRES           16 // number of microsteps
890
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
891
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
892
+
893
+    #define X2_IHOLD         31
894
+    #define X2_IRUN          31
895
+    #define X2_IHOLDDELAY    15
896
+    #define X2_I_SCALE_ANALOG 1
897
+    #define X2_MRES          16
898
+    #define X2_TBL            1
899
+    #define X2_TOFF           8
900
+
901
+    #define Y_IHOLD          31
902
+    #define Y_IRUN           31
903
+    #define Y_IHOLDDELAY     15
904
+    #define Y_I_SCALE_ANALOG  1
905
+    #define Y_MRES           16
906
+    #define Y_TBL             1
907
+    #define Y_TOFF            8
908
+
909
+    #define Y2_IHOLD         31
910
+    #define Y2_IRUN          31
911
+    #define Y2_IHOLDDELAY    15
912
+    #define Y2_I_SCALE_ANALOG 1
913
+    #define Y2_MRES          16
914
+    #define Y2_TBL            1
915
+    #define Y2_TOFF           8
916
+
917
+    #define Z_IHOLD          31
918
+    #define Z_IRUN           31
919
+    #define Z_IHOLDDELAY     15
920
+    #define Z_I_SCALE_ANALOG  1
921
+    #define Z_MRES           16
922
+    #define Z_TBL             1
923
+    #define Z_TOFF            8
924
+
925
+    #define Z2_IHOLD         31
926
+    #define Z2_IRUN          31
927
+    #define Z2_IHOLDDELAY    15
928
+    #define Z2_I_SCALE_ANALOG 1
929
+    #define Z2_MRES          16
930
+    #define Z2_TBL            1
931
+    #define Z2_TOFF           8
932
+
933
+    #define E0_IHOLD         31
934
+    #define E0_IRUN          31
935
+    #define E0_IHOLDDELAY    15
936
+    #define E0_I_SCALE_ANALOG 1
937
+    #define E0_MRES          16
938
+    #define E0_TBL            1
939
+    #define E0_TOFF           8
940
+
941
+    #define E1_IHOLD         31
942
+    #define E1_IRUN          31
943
+    #define E1_IHOLDDELAY    15
944
+    #define E1_I_SCALE_ANALOG 1
945
+    #define E1_MRES          16
946
+    #define E1_TBL            1
947
+    #define E1_TOFF           8
948
+
949
+    #define E2_IHOLD         31
950
+    #define E2_IRUN          31
951
+    #define E2_IHOLDDELAY    15
952
+    #define E2_I_SCALE_ANALOG 1
953
+    #define E2_MRES          16
954
+    #define E2_TBL            1
955
+    #define E2_TOFF           8
956
+
957
+    #define E3_IHOLD         31
958
+    #define E3_IRUN          31
959
+    #define E3_IHOLDDELAY    15
960
+    #define E3_I_SCALE_ANALOG 1
961
+    #define E3_MRES          16
962
+    #define E3_TBL            1
963
+    #define E3_TOFF           8
964
+
965
+  #endif // TMC2130_ADVANCED_CONFIGURATION
966
+
967
+#endif // HAVE_TMC2130DRIVER
968
+
969
+// @section L6470
970
+
971
+
972
+/**
973
+ * Enable this section if you have L6470 motor drivers.
974
+ * You need to import the L6470 library into the Arduino IDE for this.
975
+ * (https://github.com/ameyer/Arduino-L6470)
976
+ */
767 977
 
768 978
 //#define HAVE_L6470DRIVER
769 979
 #if ENABLED(HAVE_L6470DRIVER)
770 980
 
771 981
   //#define X_IS_L6470
772
-  #define X_MICROSTEPS 16     //number of microsteps
773
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
774
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
775
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
776
-
777 982
   //#define X2_IS_L6470
778
-  #define X2_MICROSTEPS 16     //number of microsteps
779
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
780
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
781
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
782
-
783 983
   //#define Y_IS_L6470
784
-  #define Y_MICROSTEPS 16     //number of microsteps
785
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
786
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
787
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
788
-
789 984
   //#define Y2_IS_L6470
790
-  #define Y2_MICROSTEPS 16     //number of microsteps
791
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
792
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
793
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
794
-
795 985
   //#define Z_IS_L6470
796
-  #define Z_MICROSTEPS 16     //number of microsteps
797
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
798
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
799
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
800
-
801 986
   //#define Z2_IS_L6470
802
-  #define Z2_MICROSTEPS 16     //number of microsteps
803
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
804
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
805
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
806
-
807 987
   //#define E0_IS_L6470
808
-  #define E0_MICROSTEPS 16     //number of microsteps
809
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
810
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
811
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
812
-
813 988
   //#define E1_IS_L6470
814
-  #define E1_MICROSTEPS 16     //number of microsteps
815
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
816
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
817
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
818
-
819 989
   //#define E2_IS_L6470
820
-  #define E2_MICROSTEPS 16     //number of microsteps
821
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
822
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
823
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
824
-
825 990
   //#define E3_IS_L6470
826
-  #define E3_MICROSTEPS 16     //number of microsteps
827
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
828
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
829
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
991
+
992
+  #define X_MICROSTEPS      16 // number of microsteps
993
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
994
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
995
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
996
+
997
+  #define X2_MICROSTEPS     16
998
+  #define X2_K_VAL          50
999
+  #define X2_OVERCURRENT  2000
1000
+  #define X2_STALLCURRENT 1500
1001
+
1002
+  #define Y_MICROSTEPS      16
1003
+  #define Y_K_VAL           50
1004
+  #define Y_OVERCURRENT   2000
1005
+  #define Y_STALLCURRENT  1500
1006
+
1007
+  #define Y2_MICROSTEPS     16
1008
+  #define Y2_K_VAL          50
1009
+  #define Y2_OVERCURRENT  2000
1010
+  #define Y2_STALLCURRENT 1500
1011
+
1012
+  #define Z_MICROSTEPS      16
1013
+  #define Z_K_VAL           50
1014
+  #define Z_OVERCURRENT   2000
1015
+  #define Z_STALLCURRENT  1500
1016
+
1017
+  #define Z2_MICROSTEPS     16
1018
+  #define Z2_K_VAL          50
1019
+  #define Z2_OVERCURRENT  2000
1020
+  #define Z2_STALLCURRENT 1500
1021
+
1022
+  #define E0_MICROSTEPS     16
1023
+  #define E0_K_VAL          50
1024
+  #define E0_OVERCURRENT  2000
1025
+  #define E0_STALLCURRENT 1500
1026
+
1027
+  #define E1_MICROSTEPS     16
1028
+  #define E1_K_VAL          50
1029
+  #define E1_OVERCURRENT  2000
1030
+  #define E1_STALLCURRENT 1500
1031
+
1032
+  #define E2_MICROSTEPS     16
1033
+  #define E2_K_VAL          50
1034
+  #define E2_OVERCURRENT  2000
1035
+  #define E2_STALLCURRENT 1500
1036
+
1037
+  #define E3_MICROSTEPS     16
1038
+  #define E3_K_VAL          50
1039
+  #define E3_OVERCURRENT  2000
1040
+  #define E3_STALLCURRENT 1500
830 1041
 
831 1042
 #endif
832 1043
 

+ 304
- 93
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -707,126 +707,337 @@
707 707
 #if ENABLED(HAVE_TMCDRIVER)
708 708
 
709 709
   //#define X_IS_TMC
710
-  #define X_MAX_CURRENT 1000  //in mA
711
-  #define X_SENSE_RESISTOR 91 //in mOhms
712
-  #define X_MICROSTEPS 16     //number of microsteps
713
-
714 710
   //#define X2_IS_TMC
715
-  #define X2_MAX_CURRENT 1000  //in mA
716
-  #define X2_SENSE_RESISTOR 91 //in mOhms
717
-  #define X2_MICROSTEPS 16     //number of microsteps
718
-
719 711
   //#define Y_IS_TMC
720
-  #define Y_MAX_CURRENT 1000  //in mA
721
-  #define Y_SENSE_RESISTOR 91 //in mOhms
722
-  #define Y_MICROSTEPS 16     //number of microsteps
723
-
724 712
   //#define Y2_IS_TMC
725
-  #define Y2_MAX_CURRENT 1000  //in mA
726
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
727
-  #define Y2_MICROSTEPS 16     //number of microsteps
728
-
729 713
   //#define Z_IS_TMC
730
-  #define Z_MAX_CURRENT 1000  //in mA
731
-  #define Z_SENSE_RESISTOR 91 //in mOhms
732
-  #define Z_MICROSTEPS 16     //number of microsteps
733
-
734 714
   //#define Z2_IS_TMC
735
-  #define Z2_MAX_CURRENT 1000  //in mA
736
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
737
-  #define Z2_MICROSTEPS 16     //number of microsteps
738
-
739 715
   //#define E0_IS_TMC
740
-  #define E0_MAX_CURRENT 1000  //in mA
741
-  #define E0_SENSE_RESISTOR 91 //in mOhms
742
-  #define E0_MICROSTEPS 16     //number of microsteps
743
-
744 716
   //#define E1_IS_TMC
745
-  #define E1_MAX_CURRENT 1000  //in mA
746
-  #define E1_SENSE_RESISTOR 91 //in mOhms
747
-  #define E1_MICROSTEPS 16     //number of microsteps
748
-
749 717
   //#define E2_IS_TMC
750
-  #define E2_MAX_CURRENT 1000  //in mA
751
-  #define E2_SENSE_RESISTOR 91 //in mOhms
752
-  #define E2_MICROSTEPS 16     //number of microsteps
753
-
754 718
   //#define E3_IS_TMC
755
-  #define E3_MAX_CURRENT 1000  //in mA
756
-  #define E3_SENSE_RESISTOR 91 //in mOhms
757
-  #define E3_MICROSTEPS 16     //number of microsteps
719
+
720
+  #define X_MAX_CURRENT     1000 // in mA
721
+  #define X_SENSE_RESISTOR    91 // in mOhms
722
+  #define X_MICROSTEPS        16 // number of microsteps
723
+
724
+  #define X2_MAX_CURRENT    1000
725
+  #define X2_SENSE_RESISTOR   91
726
+  #define X2_MICROSTEPS       16
727
+
728
+  #define Y_MAX_CURRENT     1000
729
+  #define Y_SENSE_RESISTOR    91
730
+  #define Y_MICROSTEPS        16
731
+
732
+  #define Y2_MAX_CURRENT    1000
733
+  #define Y2_SENSE_RESISTOR   91
734
+  #define Y2_MICROSTEPS       16
735
+
736
+  #define Z_MAX_CURRENT     1000
737
+  #define Z_SENSE_RESISTOR    91
738
+  #define Z_MICROSTEPS        16
739
+
740
+  #define Z2_MAX_CURRENT    1000
741
+  #define Z2_SENSE_RESISTOR   91
742
+  #define Z2_MICROSTEPS       16
743
+
744
+  #define E0_MAX_CURRENT    1000
745
+  #define E0_SENSE_RESISTOR   91
746
+  #define E0_MICROSTEPS       16
747
+
748
+  #define E1_MAX_CURRENT    1000
749
+  #define E1_SENSE_RESISTOR   91
750
+  #define E1_MICROSTEPS       16
751
+
752
+  #define E2_MAX_CURRENT    1000
753
+  #define E2_SENSE_RESISTOR   91
754
+  #define E2_MICROSTEPS       16
755
+
756
+  #define E3_MAX_CURRENT    1000
757
+  #define E3_SENSE_RESISTOR   91
758
+  #define E3_MICROSTEPS       16
758 759
 
759 760
 #endif
760 761
 
761
-/******************************************************************************\
762
- * enable this section if you have L6470  motor drivers.
763
- * you need to import the L6470 library into the Arduino IDE for this
764
- ******************************************************************************/
762
+// @section TMC2130
765 763
 
766
-// @section l6470
764
+
765
+/**
766
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
767
+ *
768
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
769
+ * (https://github.com/makertum/Trinamic_TMC2130).
770
+ *
771
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
772
+ * the hardware SPI interface on your board and define the required CS pins
773
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
774
+ */
775
+
776
+//#define HAVE_TMC2130DRIVER
777
+
778
+#if ENABLED(HAVE_TMC2130DRIVER)
779
+
780
+  //#define TMC2130_ADVANCED_CONFIGURATION
781
+
782
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
783
+  //#define X_IS_TMC2130
784
+  //#define X2_IS_TMC2130
785
+  //#define Y_IS_TMC2130
786
+  //#define Y2_IS_TMC2130
787
+  //#define Z_IS_TMC2130
788
+  //#define Z2_IS_TMC2130
789
+  //#define E0_IS_TMC2130
790
+  //#define E1_IS_TMC2130
791
+  //#define E2_IS_TMC2130
792
+  //#define E3_IS_TMC2130
793
+
794
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
795
+
796
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
797
+    // Enabled settings will be automatically applied to all axes specified above.
798
+    //
799
+    // Please read the TMC2130 datasheet:
800
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
801
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
802
+    //
803
+    // The following, uncommented settings are only suggestion.
804
+
805
+    /* GENERAL CONFIGURATION */
806
+
807
+    //#define GLOBAL_EN_PWM_MODE        0
808
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
809
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
810
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
811
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
812
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
813
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
814
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
815
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
817
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
818
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
819
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
820
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
821
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
822
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
823
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
824
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
825
+
826
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
827
+
828
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
829
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
830
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
831
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
832
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
834
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
835
+
836
+    /* SPI MODE CONFIGURATION */
837
+
838
+    //#define GLOBAL_XDIRECT            0
839
+
840
+    /* DCSTEP MINIMUM VELOCITY */
841
+
842
+    //#define GLOBAL_VDCMIN             0
843
+
844
+    /* MOTOR DRIVER CONFIGURATION*/
845
+
846
+    //#define GLOBAL_DEDGE              0
847
+    //#define GLOBAL_DISS2G             0
848
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
849
+    #define GLOBAL_MRES              16 // number of microsteps
850
+    #define GLOBAL_SYNC               1 // [0-15]
851
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
852
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
853
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
854
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
855
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
856
+    //#define GLOBAL_RNDTF              0
857
+    //#define GLOBAL_DISFDCC            0
858
+    //#define GLOBAL_FD                 0
859
+    //#define GLOBAL_HEND               0
860
+    //#define GLOBAL_HSTRT              0
861
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
862
+
863
+    //#define GLOBAL_SFILT              0
864
+    //#define GLOBAL_SGT                0
865
+    //#define GLOBAL_SEIMIN             0
866
+    //#define GLOBAL_SEDN               0
867
+    //#define GLOBAL_SEMAX              0
868
+    //#define GLOBAL_SEUP               0
869
+    //#define GLOBAL_SEMIN              0
870
+
871
+    //#define GLOBAL_DC_TIME            0
872
+    //#define GLOBAL_DC_SG              0
873
+
874
+    //#define GLOBAL_FREEWHEEL          0
875
+    //#define GLOBAL_PWM_SYMMETRIC      0
876
+    //#define GLOBAL_PWM_AUTOSCALE      0
877
+    //#define GLOBAL_PWM_FREQ           0
878
+    //#define GLOBAL_PWM_GRAD           0
879
+    //#define GLOBAL_PWM_AMPL           0
880
+
881
+    //#define GLOBAL_ENCM_CTRL          0
882
+
883
+  #else
884
+
885
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
886
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
887
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
888
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
889
+    #define X_MRES           16 // number of microsteps
890
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
891
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
892
+
893
+    #define X2_IHOLD         31
894
+    #define X2_IRUN          31
895
+    #define X2_IHOLDDELAY    15
896
+    #define X2_I_SCALE_ANALOG 1
897
+    #define X2_MRES          16
898
+    #define X2_TBL            1
899
+    #define X2_TOFF           8
900
+
901
+    #define Y_IHOLD          31
902
+    #define Y_IRUN           31
903
+    #define Y_IHOLDDELAY     15
904
+    #define Y_I_SCALE_ANALOG  1
905
+    #define Y_MRES           16
906
+    #define Y_TBL             1
907
+    #define Y_TOFF            8
908
+
909
+    #define Y2_IHOLD         31
910
+    #define Y2_IRUN          31
911
+    #define Y2_IHOLDDELAY    15
912
+    #define Y2_I_SCALE_ANALOG 1
913
+    #define Y2_MRES          16
914
+    #define Y2_TBL            1
915
+    #define Y2_TOFF           8
916
+
917
+    #define Z_IHOLD          31
918
+    #define Z_IRUN           31
919
+    #define Z_IHOLDDELAY     15
920
+    #define Z_I_SCALE_ANALOG  1
921
+    #define Z_MRES           16
922
+    #define Z_TBL             1
923
+    #define Z_TOFF            8
924
+
925
+    #define Z2_IHOLD         31
926
+    #define Z2_IRUN          31
927
+    #define Z2_IHOLDDELAY    15
928
+    #define Z2_I_SCALE_ANALOG 1
929
+    #define Z2_MRES          16
930
+    #define Z2_TBL            1
931
+    #define Z2_TOFF           8
932
+
933
+    #define E0_IHOLD         31
934
+    #define E0_IRUN          31
935
+    #define E0_IHOLDDELAY    15
936
+    #define E0_I_SCALE_ANALOG 1
937
+    #define E0_MRES          16
938
+    #define E0_TBL            1
939
+    #define E0_TOFF           8
940
+
941
+    #define E1_IHOLD         31
942
+    #define E1_IRUN          31
943
+    #define E1_IHOLDDELAY    15
944
+    #define E1_I_SCALE_ANALOG 1
945
+    #define E1_MRES          16
946
+    #define E1_TBL            1
947
+    #define E1_TOFF           8
948
+
949
+    #define E2_IHOLD         31
950
+    #define E2_IRUN          31
951
+    #define E2_IHOLDDELAY    15
952
+    #define E2_I_SCALE_ANALOG 1
953
+    #define E2_MRES          16
954
+    #define E2_TBL            1
955
+    #define E2_TOFF           8
956
+
957
+    #define E3_IHOLD         31
958
+    #define E3_IRUN          31
959
+    #define E3_IHOLDDELAY    15
960
+    #define E3_I_SCALE_ANALOG 1
961
+    #define E3_MRES          16
962
+    #define E3_TBL            1
963
+    #define E3_TOFF           8
964
+
965
+  #endif // TMC2130_ADVANCED_CONFIGURATION
966
+
967
+#endif // HAVE_TMC2130DRIVER
968
+
969
+// @section L6470
970
+
971
+
972
+/**
973
+ * Enable this section if you have L6470 motor drivers.
974
+ * You need to import the L6470 library into the Arduino IDE for this.
975
+ * (https://github.com/ameyer/Arduino-L6470)
976
+ */
767 977
 
768 978
 //#define HAVE_L6470DRIVER
769 979
 #if ENABLED(HAVE_L6470DRIVER)
770 980
 
771 981
   //#define X_IS_L6470
772
-  #define X_MICROSTEPS 16     //number of microsteps
773
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
774
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
775
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
776
-
777 982
   //#define X2_IS_L6470
778
-  #define X2_MICROSTEPS 16     //number of microsteps
779
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
780
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
781
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
782
-
783 983
   //#define Y_IS_L6470
784
-  #define Y_MICROSTEPS 16     //number of microsteps
785
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
786
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
787
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
788
-
789 984
   //#define Y2_IS_L6470
790
-  #define Y2_MICROSTEPS 16     //number of microsteps
791
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
792
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
793
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
794
-
795 985
   //#define Z_IS_L6470
796
-  #define Z_MICROSTEPS 16     //number of microsteps
797
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
798
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
799
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
800
-
801 986
   //#define Z2_IS_L6470
802
-  #define Z2_MICROSTEPS 16     //number of microsteps
803
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
804
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
805
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
806
-
807 987
   //#define E0_IS_L6470
808
-  #define E0_MICROSTEPS 16     //number of microsteps
809
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
810
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
811
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
812
-
813 988
   //#define E1_IS_L6470
814
-  #define E1_MICROSTEPS 16     //number of microsteps
815
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
816
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
817
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
818
-
819 989
   //#define E2_IS_L6470
820
-  #define E2_MICROSTEPS 16     //number of microsteps
821
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
822
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
823
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
824
-
825 990
   //#define E3_IS_L6470
826
-  #define E3_MICROSTEPS 16     //number of microsteps
827
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
828
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
829
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
991
+
992
+  #define X_MICROSTEPS      16 // number of microsteps
993
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
994
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
995
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
996
+
997
+  #define X2_MICROSTEPS     16
998
+  #define X2_K_VAL          50
999
+  #define X2_OVERCURRENT  2000
1000
+  #define X2_STALLCURRENT 1500
1001
+
1002
+  #define Y_MICROSTEPS      16
1003
+  #define Y_K_VAL           50
1004
+  #define Y_OVERCURRENT   2000
1005
+  #define Y_STALLCURRENT  1500
1006
+
1007
+  #define Y2_MICROSTEPS     16
1008
+  #define Y2_K_VAL          50
1009
+  #define Y2_OVERCURRENT  2000
1010
+  #define Y2_STALLCURRENT 1500
1011
+
1012
+  #define Z_MICROSTEPS      16
1013
+  #define Z_K_VAL           50
1014
+  #define Z_OVERCURRENT   2000
1015
+  #define Z_STALLCURRENT  1500
1016
+
1017
+  #define Z2_MICROSTEPS     16
1018
+  #define Z2_K_VAL          50
1019
+  #define Z2_OVERCURRENT  2000
1020
+  #define Z2_STALLCURRENT 1500
1021
+
1022
+  #define E0_MICROSTEPS     16
1023
+  #define E0_K_VAL          50
1024
+  #define E0_OVERCURRENT  2000
1025
+  #define E0_STALLCURRENT 1500
1026
+
1027
+  #define E1_MICROSTEPS     16
1028
+  #define E1_K_VAL          50
1029
+  #define E1_OVERCURRENT  2000
1030
+  #define E1_STALLCURRENT 1500
1031
+
1032
+  #define E2_MICROSTEPS     16
1033
+  #define E2_K_VAL          50
1034
+  #define E2_OVERCURRENT  2000
1035
+  #define E2_STALLCURRENT 1500
1036
+
1037
+  #define E3_MICROSTEPS     16
1038
+  #define E3_K_VAL          50
1039
+  #define E3_OVERCURRENT  2000
1040
+  #define E3_STALLCURRENT 1500
830 1041
 
831 1042
 #endif
832 1043
 

+ 304
- 93
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -712,126 +712,337 @@
712 712
 #if ENABLED(HAVE_TMCDRIVER)
713 713
 
714 714
   //#define X_IS_TMC
715
-  #define X_MAX_CURRENT 1000  //in mA
716
-  #define X_SENSE_RESISTOR 91 //in mOhms
717
-  #define X_MICROSTEPS 16     //number of microsteps
718
-
719 715
   //#define X2_IS_TMC
720
-  #define X2_MAX_CURRENT 1000  //in mA
721
-  #define X2_SENSE_RESISTOR 91 //in mOhms
722
-  #define X2_MICROSTEPS 16     //number of microsteps
723
-
724 716
   //#define Y_IS_TMC
725
-  #define Y_MAX_CURRENT 1000  //in mA
726
-  #define Y_SENSE_RESISTOR 91 //in mOhms
727
-  #define Y_MICROSTEPS 16     //number of microsteps
728
-
729 717
   //#define Y2_IS_TMC
730
-  #define Y2_MAX_CURRENT 1000  //in mA
731
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
732
-  #define Y2_MICROSTEPS 16     //number of microsteps
733
-
734 718
   //#define Z_IS_TMC
735
-  #define Z_MAX_CURRENT 1000  //in mA
736
-  #define Z_SENSE_RESISTOR 91 //in mOhms
737
-  #define Z_MICROSTEPS 16     //number of microsteps
738
-
739 719
   //#define Z2_IS_TMC
740
-  #define Z2_MAX_CURRENT 1000  //in mA
741
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
742
-  #define Z2_MICROSTEPS 16     //number of microsteps
743
-
744 720
   //#define E0_IS_TMC
745
-  #define E0_MAX_CURRENT 1000  //in mA
746
-  #define E0_SENSE_RESISTOR 91 //in mOhms
747
-  #define E0_MICROSTEPS 16     //number of microsteps
748
-
749 721
   //#define E1_IS_TMC
750
-  #define E1_MAX_CURRENT 1000  //in mA
751
-  #define E1_SENSE_RESISTOR 91 //in mOhms
752
-  #define E1_MICROSTEPS 16     //number of microsteps
753
-
754 722
   //#define E2_IS_TMC
755
-  #define E2_MAX_CURRENT 1000  //in mA
756
-  #define E2_SENSE_RESISTOR 91 //in mOhms
757
-  #define E2_MICROSTEPS 16     //number of microsteps
758
-
759 723
   //#define E3_IS_TMC
760
-  #define E3_MAX_CURRENT 1000  //in mA
761
-  #define E3_SENSE_RESISTOR 91 //in mOhms
762
-  #define E3_MICROSTEPS 16     //number of microsteps
724
+
725
+  #define X_MAX_CURRENT     1000 // in mA
726
+  #define X_SENSE_RESISTOR    91 // in mOhms
727
+  #define X_MICROSTEPS        16 // number of microsteps
728
+
729
+  #define X2_MAX_CURRENT    1000
730
+  #define X2_SENSE_RESISTOR   91
731
+  #define X2_MICROSTEPS       16
732
+
733
+  #define Y_MAX_CURRENT     1000
734
+  #define Y_SENSE_RESISTOR    91
735
+  #define Y_MICROSTEPS        16
736
+
737
+  #define Y2_MAX_CURRENT    1000
738
+  #define Y2_SENSE_RESISTOR   91
739
+  #define Y2_MICROSTEPS       16
740
+
741
+  #define Z_MAX_CURRENT     1000
742
+  #define Z_SENSE_RESISTOR    91
743
+  #define Z_MICROSTEPS        16
744
+
745
+  #define Z2_MAX_CURRENT    1000
746
+  #define Z2_SENSE_RESISTOR   91
747
+  #define Z2_MICROSTEPS       16
748
+
749
+  #define E0_MAX_CURRENT    1000
750
+  #define E0_SENSE_RESISTOR   91
751
+  #define E0_MICROSTEPS       16
752
+
753
+  #define E1_MAX_CURRENT    1000
754
+  #define E1_SENSE_RESISTOR   91
755
+  #define E1_MICROSTEPS       16
756
+
757
+  #define E2_MAX_CURRENT    1000
758
+  #define E2_SENSE_RESISTOR   91
759
+  #define E2_MICROSTEPS       16
760
+
761
+  #define E3_MAX_CURRENT    1000
762
+  #define E3_SENSE_RESISTOR   91
763
+  #define E3_MICROSTEPS       16
763 764
 
764 765
 #endif
765 766
 
766
-/******************************************************************************\
767
- * enable this section if you have L6470  motor drivers.
768
- * you need to import the L6470 library into the Arduino IDE for this
769
- ******************************************************************************/
767
+// @section TMC2130
770 768
 
771
-// @section l6470
769
+
770
+/**
771
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
772
+ *
773
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
774
+ * (https://github.com/makertum/Trinamic_TMC2130).
775
+ *
776
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
777
+ * the hardware SPI interface on your board and define the required CS pins
778
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
779
+ */
780
+
781
+//#define HAVE_TMC2130DRIVER
782
+
783
+#if ENABLED(HAVE_TMC2130DRIVER)
784
+
785
+  //#define TMC2130_ADVANCED_CONFIGURATION
786
+
787
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
788
+  //#define X_IS_TMC2130
789
+  //#define X2_IS_TMC2130
790
+  //#define Y_IS_TMC2130
791
+  //#define Y2_IS_TMC2130
792
+  //#define Z_IS_TMC2130
793
+  //#define Z2_IS_TMC2130
794
+  //#define E0_IS_TMC2130
795
+  //#define E1_IS_TMC2130
796
+  //#define E2_IS_TMC2130
797
+  //#define E3_IS_TMC2130
798
+
799
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
800
+
801
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
802
+    // Enabled settings will be automatically applied to all axes specified above.
803
+    //
804
+    // Please read the TMC2130 datasheet:
805
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
806
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
807
+    //
808
+    // The following, uncommented settings are only suggestion.
809
+
810
+    /* GENERAL CONFIGURATION */
811
+
812
+    //#define GLOBAL_EN_PWM_MODE        0
813
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
814
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
815
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
816
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
817
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
818
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
819
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
820
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
821
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
822
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
823
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
824
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
825
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
826
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
827
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
828
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
829
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
830
+
831
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
832
+
833
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
834
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
835
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
836
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
837
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
838
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
839
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
840
+
841
+    /* SPI MODE CONFIGURATION */
842
+
843
+    //#define GLOBAL_XDIRECT            0
844
+
845
+    /* DCSTEP MINIMUM VELOCITY */
846
+
847
+    //#define GLOBAL_VDCMIN             0
848
+
849
+    /* MOTOR DRIVER CONFIGURATION*/
850
+
851
+    //#define GLOBAL_DEDGE              0
852
+    //#define GLOBAL_DISS2G             0
853
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
854
+    #define GLOBAL_MRES              16 // number of microsteps
855
+    #define GLOBAL_SYNC               1 // [0-15]
856
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
857
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
858
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
859
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
860
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
861
+    //#define GLOBAL_RNDTF              0
862
+    //#define GLOBAL_DISFDCC            0
863
+    //#define GLOBAL_FD                 0
864
+    //#define GLOBAL_HEND               0
865
+    //#define GLOBAL_HSTRT              0
866
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
867
+
868
+    //#define GLOBAL_SFILT              0
869
+    //#define GLOBAL_SGT                0
870
+    //#define GLOBAL_SEIMIN             0
871
+    //#define GLOBAL_SEDN               0
872
+    //#define GLOBAL_SEMAX              0
873
+    //#define GLOBAL_SEUP               0
874
+    //#define GLOBAL_SEMIN              0
875
+
876
+    //#define GLOBAL_DC_TIME            0
877
+    //#define GLOBAL_DC_SG              0
878
+
879
+    //#define GLOBAL_FREEWHEEL          0
880
+    //#define GLOBAL_PWM_SYMMETRIC      0
881
+    //#define GLOBAL_PWM_AUTOSCALE      0
882
+    //#define GLOBAL_PWM_FREQ           0
883
+    //#define GLOBAL_PWM_GRAD           0
884
+    //#define GLOBAL_PWM_AMPL           0
885
+
886
+    //#define GLOBAL_ENCM_CTRL          0
887
+
888
+  #else
889
+
890
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
891
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
892
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
893
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
894
+    #define X_MRES           16 // number of microsteps
895
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
896
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
897
+
898
+    #define X2_IHOLD         31
899
+    #define X2_IRUN          31
900
+    #define X2_IHOLDDELAY    15
901
+    #define X2_I_SCALE_ANALOG 1
902
+    #define X2_MRES          16
903
+    #define X2_TBL            1
904
+    #define X2_TOFF           8
905
+
906
+    #define Y_IHOLD          31
907
+    #define Y_IRUN           31
908
+    #define Y_IHOLDDELAY     15
909
+    #define Y_I_SCALE_ANALOG  1
910
+    #define Y_MRES           16
911
+    #define Y_TBL             1
912
+    #define Y_TOFF            8
913
+
914
+    #define Y2_IHOLD         31
915
+    #define Y2_IRUN          31
916
+    #define Y2_IHOLDDELAY    15
917
+    #define Y2_I_SCALE_ANALOG 1
918
+    #define Y2_MRES          16
919
+    #define Y2_TBL            1
920
+    #define Y2_TOFF           8
921
+
922
+    #define Z_IHOLD          31
923
+    #define Z_IRUN           31
924
+    #define Z_IHOLDDELAY     15
925
+    #define Z_I_SCALE_ANALOG  1
926
+    #define Z_MRES           16
927
+    #define Z_TBL             1
928
+    #define Z_TOFF            8
929
+
930
+    #define Z2_IHOLD         31
931
+    #define Z2_IRUN          31
932
+    #define Z2_IHOLDDELAY    15
933
+    #define Z2_I_SCALE_ANALOG 1
934
+    #define Z2_MRES          16
935
+    #define Z2_TBL            1
936
+    #define Z2_TOFF           8
937
+
938
+    #define E0_IHOLD         31
939
+    #define E0_IRUN          31
940
+    #define E0_IHOLDDELAY    15
941
+    #define E0_I_SCALE_ANALOG 1
942
+    #define E0_MRES          16
943
+    #define E0_TBL            1
944
+    #define E0_TOFF           8
945
+
946
+    #define E1_IHOLD         31
947
+    #define E1_IRUN          31
948
+    #define E1_IHOLDDELAY    15
949
+    #define E1_I_SCALE_ANALOG 1
950
+    #define E1_MRES          16
951
+    #define E1_TBL            1
952
+    #define E1_TOFF           8
953
+
954
+    #define E2_IHOLD         31
955
+    #define E2_IRUN          31
956
+    #define E2_IHOLDDELAY    15
957
+    #define E2_I_SCALE_ANALOG 1
958
+    #define E2_MRES          16
959
+    #define E2_TBL            1
960
+    #define E2_TOFF           8
961
+
962
+    #define E3_IHOLD         31
963
+    #define E3_IRUN          31
964
+    #define E3_IHOLDDELAY    15
965
+    #define E3_I_SCALE_ANALOG 1
966
+    #define E3_MRES          16
967
+    #define E3_TBL            1
968
+    #define E3_TOFF           8
969
+
970
+  #endif // TMC2130_ADVANCED_CONFIGURATION
971
+
972
+#endif // HAVE_TMC2130DRIVER
973
+
974
+// @section L6470
975
+
976
+
977
+/**
978
+ * Enable this section if you have L6470 motor drivers.
979
+ * You need to import the L6470 library into the Arduino IDE for this.
980
+ * (https://github.com/ameyer/Arduino-L6470)
981
+ */
772 982
 
773 983
 //#define HAVE_L6470DRIVER
774 984
 #if ENABLED(HAVE_L6470DRIVER)
775 985
 
776 986
   //#define X_IS_L6470
777
-  #define X_MICROSTEPS 16     //number of microsteps
778
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
779
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
780
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
781
-
782 987
   //#define X2_IS_L6470
783
-  #define X2_MICROSTEPS 16     //number of microsteps
784
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
785
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
786
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
787
-
788 988
   //#define Y_IS_L6470
789
-  #define Y_MICROSTEPS 16     //number of microsteps
790
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
791
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
792
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
793
-
794 989
   //#define Y2_IS_L6470
795
-  #define Y2_MICROSTEPS 16     //number of microsteps
796
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
797
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
798
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
799
-
800 990
   //#define Z_IS_L6470
801
-  #define Z_MICROSTEPS 16     //number of microsteps
802
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
803
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
804
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
805
-
806 991
   //#define Z2_IS_L6470
807
-  #define Z2_MICROSTEPS 16     //number of microsteps
808
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
809
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
810
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
811
-
812 992
   //#define E0_IS_L6470
813
-  #define E0_MICROSTEPS 16     //number of microsteps
814
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
815
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
816
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
817
-
818 993
   //#define E1_IS_L6470
819
-  #define E1_MICROSTEPS 16     //number of microsteps
820
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
821
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
822
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
823
-
824 994
   //#define E2_IS_L6470
825
-  #define E2_MICROSTEPS 16     //number of microsteps
826
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
827
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
828
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
829
-
830 995
   //#define E3_IS_L6470
831
-  #define E3_MICROSTEPS 16     //number of microsteps
832
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
833
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
834
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
996
+
997
+  #define X_MICROSTEPS      16 // number of microsteps
998
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
999
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
1000
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
1001
+
1002
+  #define X2_MICROSTEPS     16
1003
+  #define X2_K_VAL          50
1004
+  #define X2_OVERCURRENT  2000
1005
+  #define X2_STALLCURRENT 1500
1006
+
1007
+  #define Y_MICROSTEPS      16
1008
+  #define Y_K_VAL           50
1009
+  #define Y_OVERCURRENT   2000
1010
+  #define Y_STALLCURRENT  1500
1011
+
1012
+  #define Y2_MICROSTEPS     16
1013
+  #define Y2_K_VAL          50
1014
+  #define Y2_OVERCURRENT  2000
1015
+  #define Y2_STALLCURRENT 1500
1016
+
1017
+  #define Z_MICROSTEPS      16
1018
+  #define Z_K_VAL           50
1019
+  #define Z_OVERCURRENT   2000
1020
+  #define Z_STALLCURRENT  1500
1021
+
1022
+  #define Z2_MICROSTEPS     16
1023
+  #define Z2_K_VAL          50
1024
+  #define Z2_OVERCURRENT  2000
1025
+  #define Z2_STALLCURRENT 1500
1026
+
1027
+  #define E0_MICROSTEPS     16
1028
+  #define E0_K_VAL          50
1029
+  #define E0_OVERCURRENT  2000
1030
+  #define E0_STALLCURRENT 1500
1031
+
1032
+  #define E1_MICROSTEPS     16
1033
+  #define E1_K_VAL          50
1034
+  #define E1_OVERCURRENT  2000
1035
+  #define E1_STALLCURRENT 1500
1036
+
1037
+  #define E2_MICROSTEPS     16
1038
+  #define E2_K_VAL          50
1039
+  #define E2_OVERCURRENT  2000
1040
+  #define E2_STALLCURRENT 1500
1041
+
1042
+  #define E3_MICROSTEPS     16
1043
+  #define E3_K_VAL          50
1044
+  #define E3_OVERCURRENT  2000
1045
+  #define E3_STALLCURRENT 1500
835 1046
 
836 1047
 #endif
837 1048
 

+ 304
- 93
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -707,126 +707,337 @@
707 707
 #if ENABLED(HAVE_TMCDRIVER)
708 708
 
709 709
   //#define X_IS_TMC
710
-  #define X_MAX_CURRENT 1000  //in mA
711
-  #define X_SENSE_RESISTOR 91 //in mOhms
712
-  #define X_MICROSTEPS 16     //number of microsteps
713
-
714 710
   //#define X2_IS_TMC
715
-  #define X2_MAX_CURRENT 1000  //in mA
716
-  #define X2_SENSE_RESISTOR 91 //in mOhms
717
-  #define X2_MICROSTEPS 16     //number of microsteps
718
-
719 711
   //#define Y_IS_TMC
720
-  #define Y_MAX_CURRENT 1000  //in mA
721
-  #define Y_SENSE_RESISTOR 91 //in mOhms
722
-  #define Y_MICROSTEPS 16     //number of microsteps
723
-
724 712
   //#define Y2_IS_TMC
725
-  #define Y2_MAX_CURRENT 1000  //in mA
726
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
727
-  #define Y2_MICROSTEPS 16     //number of microsteps
728
-
729 713
   //#define Z_IS_TMC
730
-  #define Z_MAX_CURRENT 1000  //in mA
731
-  #define Z_SENSE_RESISTOR 91 //in mOhms
732
-  #define Z_MICROSTEPS 16     //number of microsteps
733
-
734 714
   //#define Z2_IS_TMC
735
-  #define Z2_MAX_CURRENT 1000  //in mA
736
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
737
-  #define Z2_MICROSTEPS 16     //number of microsteps
738
-
739 715
   //#define E0_IS_TMC
740
-  #define E0_MAX_CURRENT 1000  //in mA
741
-  #define E0_SENSE_RESISTOR 91 //in mOhms
742
-  #define E0_MICROSTEPS 16     //number of microsteps
743
-
744 716
   //#define E1_IS_TMC
745
-  #define E1_MAX_CURRENT 1000  //in mA
746
-  #define E1_SENSE_RESISTOR 91 //in mOhms
747
-  #define E1_MICROSTEPS 16     //number of microsteps
748
-
749 717
   //#define E2_IS_TMC
750
-  #define E2_MAX_CURRENT 1000  //in mA
751
-  #define E2_SENSE_RESISTOR 91 //in mOhms
752
-  #define E2_MICROSTEPS 16     //number of microsteps
753
-
754 718
   //#define E3_IS_TMC
755
-  #define E3_MAX_CURRENT 1000  //in mA
756
-  #define E3_SENSE_RESISTOR 91 //in mOhms
757
-  #define E3_MICROSTEPS 16     //number of microsteps
719
+
720
+  #define X_MAX_CURRENT     1000 // in mA
721
+  #define X_SENSE_RESISTOR    91 // in mOhms
722
+  #define X_MICROSTEPS        16 // number of microsteps
723
+
724
+  #define X2_MAX_CURRENT    1000
725
+  #define X2_SENSE_RESISTOR   91
726
+  #define X2_MICROSTEPS       16
727
+
728
+  #define Y_MAX_CURRENT     1000
729
+  #define Y_SENSE_RESISTOR    91
730
+  #define Y_MICROSTEPS        16
731
+
732
+  #define Y2_MAX_CURRENT    1000
733
+  #define Y2_SENSE_RESISTOR   91
734
+  #define Y2_MICROSTEPS       16
735
+
736
+  #define Z_MAX_CURRENT     1000
737
+  #define Z_SENSE_RESISTOR    91
738
+  #define Z_MICROSTEPS        16
739
+
740
+  #define Z2_MAX_CURRENT    1000
741
+  #define Z2_SENSE_RESISTOR   91
742
+  #define Z2_MICROSTEPS       16
743
+
744
+  #define E0_MAX_CURRENT    1000
745
+  #define E0_SENSE_RESISTOR   91
746
+  #define E0_MICROSTEPS       16
747
+
748
+  #define E1_MAX_CURRENT    1000
749
+  #define E1_SENSE_RESISTOR   91
750
+  #define E1_MICROSTEPS       16
751
+
752
+  #define E2_MAX_CURRENT    1000
753
+  #define E2_SENSE_RESISTOR   91
754
+  #define E2_MICROSTEPS       16
755
+
756
+  #define E3_MAX_CURRENT    1000
757
+  #define E3_SENSE_RESISTOR   91
758
+  #define E3_MICROSTEPS       16
758 759
 
759 760
 #endif
760 761
 
761
-/******************************************************************************\
762
- * enable this section if you have L6470  motor drivers.
763
- * you need to import the L6470 library into the Arduino IDE for this
764
- ******************************************************************************/
762
+// @section TMC2130
765 763
 
766
-// @section l6470
764
+
765
+/**
766
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
767
+ *
768
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
769
+ * (https://github.com/makertum/Trinamic_TMC2130).
770
+ *
771
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
772
+ * the hardware SPI interface on your board and define the required CS pins
773
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
774
+ */
775
+
776
+//#define HAVE_TMC2130DRIVER
777
+
778
+#if ENABLED(HAVE_TMC2130DRIVER)
779
+
780
+  //#define TMC2130_ADVANCED_CONFIGURATION
781
+
782
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
783
+  //#define X_IS_TMC2130
784
+  //#define X2_IS_TMC2130
785
+  //#define Y_IS_TMC2130
786
+  //#define Y2_IS_TMC2130
787
+  //#define Z_IS_TMC2130
788
+  //#define Z2_IS_TMC2130
789
+  //#define E0_IS_TMC2130
790
+  //#define E1_IS_TMC2130
791
+  //#define E2_IS_TMC2130
792
+  //#define E3_IS_TMC2130
793
+
794
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
795
+
796
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
797
+    // Enabled settings will be automatically applied to all axes specified above.
798
+    //
799
+    // Please read the TMC2130 datasheet:
800
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
801
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
802
+    //
803
+    // The following, uncommented settings are only suggestion.
804
+
805
+    /* GENERAL CONFIGURATION */
806
+
807
+    //#define GLOBAL_EN_PWM_MODE        0
808
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
809
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
810
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
811
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
812
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
813
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
814
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
815
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
817
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
818
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
819
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
820
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
821
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
822
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
823
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
824
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
825
+
826
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
827
+
828
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
829
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
830
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
831
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
832
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
834
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
835
+
836
+    /* SPI MODE CONFIGURATION */
837
+
838
+    //#define GLOBAL_XDIRECT            0
839
+
840
+    /* DCSTEP MINIMUM VELOCITY */
841
+
842
+    //#define GLOBAL_VDCMIN             0
843
+
844
+    /* MOTOR DRIVER CONFIGURATION*/
845
+
846
+    //#define GLOBAL_DEDGE              0
847
+    //#define GLOBAL_DISS2G             0
848
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
849
+    #define GLOBAL_MRES              16 // number of microsteps
850
+    #define GLOBAL_SYNC               1 // [0-15]
851
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
852
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
853
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
854
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
855
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
856
+    //#define GLOBAL_RNDTF              0
857
+    //#define GLOBAL_DISFDCC            0
858
+    //#define GLOBAL_FD                 0
859
+    //#define GLOBAL_HEND               0
860
+    //#define GLOBAL_HSTRT              0
861
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
862
+
863
+    //#define GLOBAL_SFILT              0
864
+    //#define GLOBAL_SGT                0
865
+    //#define GLOBAL_SEIMIN             0
866
+    //#define GLOBAL_SEDN               0
867
+    //#define GLOBAL_SEMAX              0
868
+    //#define GLOBAL_SEUP               0
869
+    //#define GLOBAL_SEMIN              0
870
+
871
+    //#define GLOBAL_DC_TIME            0
872
+    //#define GLOBAL_DC_SG              0
873
+
874
+    //#define GLOBAL_FREEWHEEL          0
875
+    //#define GLOBAL_PWM_SYMMETRIC      0
876
+    //#define GLOBAL_PWM_AUTOSCALE      0
877
+    //#define GLOBAL_PWM_FREQ           0
878
+    //#define GLOBAL_PWM_GRAD           0
879
+    //#define GLOBAL_PWM_AMPL           0
880
+
881
+    //#define GLOBAL_ENCM_CTRL          0
882
+
883
+  #else
884
+
885
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
886
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
887
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
888
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
889
+    #define X_MRES           16 // number of microsteps
890
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
891
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
892
+
893
+    #define X2_IHOLD         31
894
+    #define X2_IRUN          31
895
+    #define X2_IHOLDDELAY    15
896
+    #define X2_I_SCALE_ANALOG 1
897
+    #define X2_MRES          16
898
+    #define X2_TBL            1
899
+    #define X2_TOFF           8
900
+
901
+    #define Y_IHOLD          31
902
+    #define Y_IRUN           31
903
+    #define Y_IHOLDDELAY     15
904
+    #define Y_I_SCALE_ANALOG  1
905
+    #define Y_MRES           16
906
+    #define Y_TBL             1
907
+    #define Y_TOFF            8
908
+
909
+    #define Y2_IHOLD         31
910
+    #define Y2_IRUN          31
911
+    #define Y2_IHOLDDELAY    15
912
+    #define Y2_I_SCALE_ANALOG 1
913
+    #define Y2_MRES          16
914
+    #define Y2_TBL            1
915
+    #define Y2_TOFF           8
916
+
917
+    #define Z_IHOLD          31
918
+    #define Z_IRUN           31
919
+    #define Z_IHOLDDELAY     15
920
+    #define Z_I_SCALE_ANALOG  1
921
+    #define Z_MRES           16
922
+    #define Z_TBL             1
923
+    #define Z_TOFF            8
924
+
925
+    #define Z2_IHOLD         31
926
+    #define Z2_IRUN          31
927
+    #define Z2_IHOLDDELAY    15
928
+    #define Z2_I_SCALE_ANALOG 1
929
+    #define Z2_MRES          16
930
+    #define Z2_TBL            1
931
+    #define Z2_TOFF           8
932
+
933
+    #define E0_IHOLD         31
934
+    #define E0_IRUN          31
935
+    #define E0_IHOLDDELAY    15
936
+    #define E0_I_SCALE_ANALOG 1
937
+    #define E0_MRES          16
938
+    #define E0_TBL            1
939
+    #define E0_TOFF           8
940
+
941
+    #define E1_IHOLD         31
942
+    #define E1_IRUN          31
943
+    #define E1_IHOLDDELAY    15
944
+    #define E1_I_SCALE_ANALOG 1
945
+    #define E1_MRES          16
946
+    #define E1_TBL            1
947
+    #define E1_TOFF           8
948
+
949
+    #define E2_IHOLD         31
950
+    #define E2_IRUN          31
951
+    #define E2_IHOLDDELAY    15
952
+    #define E2_I_SCALE_ANALOG 1
953
+    #define E2_MRES          16
954
+    #define E2_TBL            1
955
+    #define E2_TOFF           8
956
+
957
+    #define E3_IHOLD         31
958
+    #define E3_IRUN          31
959
+    #define E3_IHOLDDELAY    15
960
+    #define E3_I_SCALE_ANALOG 1
961
+    #define E3_MRES          16
962
+    #define E3_TBL            1
963
+    #define E3_TOFF           8
964
+
965
+  #endif // TMC2130_ADVANCED_CONFIGURATION
966
+
967
+#endif // HAVE_TMC2130DRIVER
968
+
969
+// @section L6470
970
+
971
+
972
+/**
973
+ * Enable this section if you have L6470 motor drivers.
974
+ * You need to import the L6470 library into the Arduino IDE for this.
975
+ * (https://github.com/ameyer/Arduino-L6470)
976
+ */
767 977
 
768 978
 //#define HAVE_L6470DRIVER
769 979
 #if ENABLED(HAVE_L6470DRIVER)
770 980
 
771 981
   //#define X_IS_L6470
772
-  #define X_MICROSTEPS 16     //number of microsteps
773
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
774
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
775
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
776
-
777 982
   //#define X2_IS_L6470
778
-  #define X2_MICROSTEPS 16     //number of microsteps
779
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
780
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
781
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
782
-
783 983
   //#define Y_IS_L6470
784
-  #define Y_MICROSTEPS 16     //number of microsteps
785
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
786
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
787
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
788
-
789 984
   //#define Y2_IS_L6470
790
-  #define Y2_MICROSTEPS 16     //number of microsteps
791
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
792
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
793
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
794
-
795 985
   //#define Z_IS_L6470
796
-  #define Z_MICROSTEPS 16     //number of microsteps
797
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
798
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
799
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
800
-
801 986
   //#define Z2_IS_L6470
802
-  #define Z2_MICROSTEPS 16     //number of microsteps
803
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
804
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
805
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
806
-
807 987
   //#define E0_IS_L6470
808
-  #define E0_MICROSTEPS 16     //number of microsteps
809
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
810
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
811
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
812
-
813 988
   //#define E1_IS_L6470
814
-  #define E1_MICROSTEPS 16     //number of microsteps
815
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
816
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
817
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
818
-
819 989
   //#define E2_IS_L6470
820
-  #define E2_MICROSTEPS 16     //number of microsteps
821
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
822
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
823
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
824
-
825 990
   //#define E3_IS_L6470
826
-  #define E3_MICROSTEPS 16     //number of microsteps
827
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
828
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
829
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
991
+
992
+  #define X_MICROSTEPS      16 // number of microsteps
993
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
994
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
995
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
996
+
997
+  #define X2_MICROSTEPS     16
998
+  #define X2_K_VAL          50
999
+  #define X2_OVERCURRENT  2000
1000
+  #define X2_STALLCURRENT 1500
1001
+
1002
+  #define Y_MICROSTEPS      16
1003
+  #define Y_K_VAL           50
1004
+  #define Y_OVERCURRENT   2000
1005
+  #define Y_STALLCURRENT  1500
1006
+
1007
+  #define Y2_MICROSTEPS     16
1008
+  #define Y2_K_VAL          50
1009
+  #define Y2_OVERCURRENT  2000
1010
+  #define Y2_STALLCURRENT 1500
1011
+
1012
+  #define Z_MICROSTEPS      16
1013
+  #define Z_K_VAL           50
1014
+  #define Z_OVERCURRENT   2000
1015
+  #define Z_STALLCURRENT  1500
1016
+
1017
+  #define Z2_MICROSTEPS     16
1018
+  #define Z2_K_VAL          50
1019
+  #define Z2_OVERCURRENT  2000
1020
+  #define Z2_STALLCURRENT 1500
1021
+
1022
+  #define E0_MICROSTEPS     16
1023
+  #define E0_K_VAL          50
1024
+  #define E0_OVERCURRENT  2000
1025
+  #define E0_STALLCURRENT 1500
1026
+
1027
+  #define E1_MICROSTEPS     16
1028
+  #define E1_K_VAL          50
1029
+  #define E1_OVERCURRENT  2000
1030
+  #define E1_STALLCURRENT 1500
1031
+
1032
+  #define E2_MICROSTEPS     16
1033
+  #define E2_K_VAL          50
1034
+  #define E2_OVERCURRENT  2000
1035
+  #define E2_STALLCURRENT 1500
1036
+
1037
+  #define E3_MICROSTEPS     16
1038
+  #define E3_K_VAL          50
1039
+  #define E3_OVERCURRENT  2000
1040
+  #define E3_STALLCURRENT 1500
830 1041
 
831 1042
 #endif
832 1043
 

+ 304
- 93
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -705,126 +705,337 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
763 761
 
764
-// @section l6470
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
968
+
969
+
970
+/**
971
+ * Enable this section if you have L6470 motor drivers.
972
+ * You need to import the L6470 library into the Arduino IDE for this.
973
+ * (https://github.com/ameyer/Arduino-L6470)
974
+ */
765 975
 
766 976
 //#define HAVE_L6470DRIVER
767 977
 #if ENABLED(HAVE_L6470DRIVER)
768 978
 
769 979
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 980
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 981
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 982
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 983
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 984
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 985
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 986
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 987
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 988
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
989
+
990
+  #define X_MICROSTEPS      16 // number of microsteps
991
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
992
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
993
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
994
+
995
+  #define X2_MICROSTEPS     16
996
+  #define X2_K_VAL          50
997
+  #define X2_OVERCURRENT  2000
998
+  #define X2_STALLCURRENT 1500
999
+
1000
+  #define Y_MICROSTEPS      16
1001
+  #define Y_K_VAL           50
1002
+  #define Y_OVERCURRENT   2000
1003
+  #define Y_STALLCURRENT  1500
1004
+
1005
+  #define Y2_MICROSTEPS     16
1006
+  #define Y2_K_VAL          50
1007
+  #define Y2_OVERCURRENT  2000
1008
+  #define Y2_STALLCURRENT 1500
1009
+
1010
+  #define Z_MICROSTEPS      16
1011
+  #define Z_K_VAL           50
1012
+  #define Z_OVERCURRENT   2000
1013
+  #define Z_STALLCURRENT  1500
1014
+
1015
+  #define Z2_MICROSTEPS     16
1016
+  #define Z2_K_VAL          50
1017
+  #define Z2_OVERCURRENT  2000
1018
+  #define Z2_STALLCURRENT 1500
1019
+
1020
+  #define E0_MICROSTEPS     16
1021
+  #define E0_K_VAL          50
1022
+  #define E0_OVERCURRENT  2000
1023
+  #define E0_STALLCURRENT 1500
1024
+
1025
+  #define E1_MICROSTEPS     16
1026
+  #define E1_K_VAL          50
1027
+  #define E1_OVERCURRENT  2000
1028
+  #define E1_STALLCURRENT 1500
1029
+
1030
+  #define E2_MICROSTEPS     16
1031
+  #define E2_K_VAL          50
1032
+  #define E2_OVERCURRENT  2000
1033
+  #define E2_STALLCURRENT 1500
1034
+
1035
+  #define E3_MICROSTEPS     16
1036
+  #define E3_K_VAL          50
1037
+  #define E3_OVERCURRENT  2000
1038
+  #define E3_STALLCURRENT 1500
828 1039
 
829 1040
 #endif
830 1041
 

+ 304
- 93
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -705,126 +705,337 @@
705 705
 #if ENABLED(HAVE_TMCDRIVER)
706 706
 
707 707
   //#define X_IS_TMC
708
-  #define X_MAX_CURRENT 1000  //in mA
709
-  #define X_SENSE_RESISTOR 91 //in mOhms
710
-  #define X_MICROSTEPS 16     //number of microsteps
711
-
712 708
   //#define X2_IS_TMC
713
-  #define X2_MAX_CURRENT 1000  //in mA
714
-  #define X2_SENSE_RESISTOR 91 //in mOhms
715
-  #define X2_MICROSTEPS 16     //number of microsteps
716
-
717 709
   //#define Y_IS_TMC
718
-  #define Y_MAX_CURRENT 1000  //in mA
719
-  #define Y_SENSE_RESISTOR 91 //in mOhms
720
-  #define Y_MICROSTEPS 16     //number of microsteps
721
-
722 710
   //#define Y2_IS_TMC
723
-  #define Y2_MAX_CURRENT 1000  //in mA
724
-  #define Y2_SENSE_RESISTOR 91 //in mOhms
725
-  #define Y2_MICROSTEPS 16     //number of microsteps
726
-
727 711
   //#define Z_IS_TMC
728
-  #define Z_MAX_CURRENT 1000  //in mA
729
-  #define Z_SENSE_RESISTOR 91 //in mOhms
730
-  #define Z_MICROSTEPS 16     //number of microsteps
731
-
732 712
   //#define Z2_IS_TMC
733
-  #define Z2_MAX_CURRENT 1000  //in mA
734
-  #define Z2_SENSE_RESISTOR 91 //in mOhms
735
-  #define Z2_MICROSTEPS 16     //number of microsteps
736
-
737 713
   //#define E0_IS_TMC
738
-  #define E0_MAX_CURRENT 1000  //in mA
739
-  #define E0_SENSE_RESISTOR 91 //in mOhms
740
-  #define E0_MICROSTEPS 16     //number of microsteps
741
-
742 714
   //#define E1_IS_TMC
743
-  #define E1_MAX_CURRENT 1000  //in mA
744
-  #define E1_SENSE_RESISTOR 91 //in mOhms
745
-  #define E1_MICROSTEPS 16     //number of microsteps
746
-
747 715
   //#define E2_IS_TMC
748
-  #define E2_MAX_CURRENT 1000  //in mA
749
-  #define E2_SENSE_RESISTOR 91 //in mOhms
750
-  #define E2_MICROSTEPS 16     //number of microsteps
751
-
752 716
   //#define E3_IS_TMC
753
-  #define E3_MAX_CURRENT 1000  //in mA
754
-  #define E3_SENSE_RESISTOR 91 //in mOhms
755
-  #define E3_MICROSTEPS 16     //number of microsteps
717
+
718
+  #define X_MAX_CURRENT     1000 // in mA
719
+  #define X_SENSE_RESISTOR    91 // in mOhms
720
+  #define X_MICROSTEPS        16 // number of microsteps
721
+
722
+  #define X2_MAX_CURRENT    1000
723
+  #define X2_SENSE_RESISTOR   91
724
+  #define X2_MICROSTEPS       16
725
+
726
+  #define Y_MAX_CURRENT     1000
727
+  #define Y_SENSE_RESISTOR    91
728
+  #define Y_MICROSTEPS        16
729
+
730
+  #define Y2_MAX_CURRENT    1000
731
+  #define Y2_SENSE_RESISTOR   91
732
+  #define Y2_MICROSTEPS       16
733
+
734
+  #define Z_MAX_CURRENT     1000
735
+  #define Z_SENSE_RESISTOR    91
736
+  #define Z_MICROSTEPS        16
737
+
738
+  #define Z2_MAX_CURRENT    1000
739
+  #define Z2_SENSE_RESISTOR   91
740
+  #define Z2_MICROSTEPS       16
741
+
742
+  #define E0_MAX_CURRENT    1000
743
+  #define E0_SENSE_RESISTOR   91
744
+  #define E0_MICROSTEPS       16
745
+
746
+  #define E1_MAX_CURRENT    1000
747
+  #define E1_SENSE_RESISTOR   91
748
+  #define E1_MICROSTEPS       16
749
+
750
+  #define E2_MAX_CURRENT    1000
751
+  #define E2_SENSE_RESISTOR   91
752
+  #define E2_MICROSTEPS       16
753
+
754
+  #define E3_MAX_CURRENT    1000
755
+  #define E3_SENSE_RESISTOR   91
756
+  #define E3_MICROSTEPS       16
756 757
 
757 758
 #endif
758 759
 
759
-/******************************************************************************\
760
- * enable this section if you have L6470  motor drivers.
761
- * you need to import the L6470 library into the Arduino IDE for this
762
- ******************************************************************************/
760
+// @section TMC2130
763 761
 
764
-// @section l6470
762
+
763
+/**
764
+ * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
765
+ *
766
+ * To use TMC2130 drivers in SPI mode, you'll also need the TMC2130 Arduino library
767
+ * (https://github.com/makertum/Trinamic_TMC2130).
768
+ *
769
+ * To use TMC2130 stepper drivers in SPI mode connect your SPI2130 pins to
770
+ * the hardware SPI interface on your board and define the required CS pins
771
+ * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
772
+ */
773
+
774
+//#define HAVE_TMC2130DRIVER
775
+
776
+#if ENABLED(HAVE_TMC2130DRIVER)
777
+
778
+  //#define TMC2130_ADVANCED_CONFIGURATION
779
+
780
+  // CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
781
+  //#define X_IS_TMC2130
782
+  //#define X2_IS_TMC2130
783
+  //#define Y_IS_TMC2130
784
+  //#define Y2_IS_TMC2130
785
+  //#define Z_IS_TMC2130
786
+  //#define Z2_IS_TMC2130
787
+  //#define E0_IS_TMC2130
788
+  //#define E1_IS_TMC2130
789
+  //#define E2_IS_TMC2130
790
+  //#define E3_IS_TMC2130
791
+
792
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
793
+
794
+    // If you've enabled TMC2130_ADVANCED_CONFIGURATION, define global settings below.
795
+    // Enabled settings will be automatically applied to all axes specified above.
796
+    //
797
+    // Please read the TMC2130 datasheet:
798
+    // http://www.trinamic.com/_articles/products/integrated-circuits/tmc2130/_datasheet/TMC2130_datasheet.pdf
799
+    // All settings here have the same (sometimes cryptic) names as in the datasheet.
800
+    //
801
+    // The following, uncommented settings are only suggestion.
802
+
803
+    /* GENERAL CONFIGURATION */
804
+
805
+    //#define GLOBAL_EN_PWM_MODE        0
806
+    #define GLOBAL_I_SCALE_ANALOG     1 // [0,1] 0: Normal, 1: AIN
807
+    //#define GLOBAL_INTERNAL_RSENSE    0 // [0,1] 0: Normal, 1: Internal
808
+    #define GLOBAL_EN_PWM_MODE        0 // [0,1] 0: Normal, 1: stealthChop with velocity threshold
809
+    //#define GLOBAL_ENC_COMMUTATION    0 // [0,1]
810
+    #define GLOBAL_SHAFT              0 // [0,1] 0: normal, 1: invert
811
+    //#define GLOBAL_DIAG0_ERROR        0 // [0,1]
812
+    //#define GLOBAL_DIAG0_OTPW         0 // [0,1]
813
+    //#define GLOBAL_DIAG0_STALL        0 // [0,1]
814
+    //#define GLOBAL_DIAG1_STALL        0 // [0,1]
815
+    //#define GLOBAL_DIAG1_INDEX        0 // [0,1]
816
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
817
+    //#define GLOBAL_DIAG1_ONSTATE      0 // [0,1]
818
+    //#define GLOBAL_DIAG0_INT_PUSHPULL 0 // [0,1]
819
+    //#define GLOBAL_DIAG1_INT_PUSHPULL 0 // [0,1]
820
+    //#define GLOBAL_SMALL_HYSTERESIS   0 // [0,1]
821
+    //#define GLOBAL_STOP_ENABLE        0 // [0,1]
822
+    //#define GLOBAL_DIRECT_MODE        0 // [0,1]
823
+
824
+    /* VELOCITY-DEPENDENT DRIVE FEATURES */
825
+
826
+    #define GLOBAL_IHOLD             22 // [0-31] 0: min, 31: max
827
+    #define GLOBAL_IRUN              31 // [0-31] 0: min, 31: max
828
+    #define GLOBAL_IHOLDDELAY        15 // [0-15] 0: min, 15: about 4 seconds
829
+    //#define GLOBAL_TPOWERDOWN         0 // [0-255] 0: min, 255: about 4 seconds
830
+    //#define GLOBAL_TPWMTHRS           0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
831
+    //#define GLOBAL_TCOOLTHRS          0 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
832
+    #define GLOBAL_THIGH             10 // [0-1048576] e.g. 20 corresponds with 2000 steps/s
833
+
834
+    /* SPI MODE CONFIGURATION */
835
+
836
+    //#define GLOBAL_XDIRECT            0
837
+
838
+    /* DCSTEP MINIMUM VELOCITY */
839
+
840
+    //#define GLOBAL_VDCMIN             0
841
+
842
+    /* MOTOR DRIVER CONFIGURATION*/
843
+
844
+    //#define GLOBAL_DEDGE              0
845
+    //#define GLOBAL_DISS2G             0
846
+    #define GLOBAL_INTPOL             1 // 0: off 1: 256 microstep interpolation
847
+    #define GLOBAL_MRES              16 // number of microsteps
848
+    #define GLOBAL_SYNC               1 // [0-15]
849
+    #define GLOBAL_VHIGHCHM           1 // [0,1] 0: normal, 1: high velocity stepper mode
850
+    #define GLOBAL_VHIGHFS            0 // [0,1] 0: normal, 1: switch to full steps for high velocities
851
+    // #define GLOBAL_VSENSE            0 // [0,1] 0: normal, 1: high sensitivity (not recommended)
852
+    #define GLOBAL_TBL                1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
853
+    #define GLOBAL_CHM                0 // [0,1] 0: spreadCycle, 1: Constant off time with fast decay time.
854
+    //#define GLOBAL_RNDTF              0
855
+    //#define GLOBAL_DISFDCC            0
856
+    //#define GLOBAL_FD                 0
857
+    //#define GLOBAL_HEND               0
858
+    //#define GLOBAL_HSTRT              0
859
+    #define GLOBAL_TOFF              10 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
860
+
861
+    //#define GLOBAL_SFILT              0
862
+    //#define GLOBAL_SGT                0
863
+    //#define GLOBAL_SEIMIN             0
864
+    //#define GLOBAL_SEDN               0
865
+    //#define GLOBAL_SEMAX              0
866
+    //#define GLOBAL_SEUP               0
867
+    //#define GLOBAL_SEMIN              0
868
+
869
+    //#define GLOBAL_DC_TIME            0
870
+    //#define GLOBAL_DC_SG              0
871
+
872
+    //#define GLOBAL_FREEWHEEL          0
873
+    //#define GLOBAL_PWM_SYMMETRIC      0
874
+    //#define GLOBAL_PWM_AUTOSCALE      0
875
+    //#define GLOBAL_PWM_FREQ           0
876
+    //#define GLOBAL_PWM_GRAD           0
877
+    //#define GLOBAL_PWM_AMPL           0
878
+
879
+    //#define GLOBAL_ENCM_CTRL          0
880
+
881
+  #else
882
+
883
+    #define X_IHOLD          31 // [0-31] 0: min, 31: max
884
+    #define X_IRUN           31 // [0-31] 0: min, 31: max
885
+    #define X_IHOLDDELAY     15 // [0-15] 0: min, 15: about 4 seconds
886
+    #define X_I_SCALE_ANALOG  1 // 0: Normal, 1: AIN
887
+    #define X_MRES           16 // number of microsteps
888
+    #define X_TBL             1 // 0-3: set comparator blank time to 16, 24, 36 or 54 clocks, 1 or 2 is recommended
889
+    #define X_TOFF            8 // 0: driver disable, 1: use only with TBL>2, 2-15: off time setting during slow decay phase
890
+
891
+    #define X2_IHOLD         31
892
+    #define X2_IRUN          31
893
+    #define X2_IHOLDDELAY    15
894
+    #define X2_I_SCALE_ANALOG 1
895
+    #define X2_MRES          16
896
+    #define X2_TBL            1
897
+    #define X2_TOFF           8
898
+
899
+    #define Y_IHOLD          31
900
+    #define Y_IRUN           31
901
+    #define Y_IHOLDDELAY     15
902
+    #define Y_I_SCALE_ANALOG  1
903
+    #define Y_MRES           16
904
+    #define Y_TBL             1
905
+    #define Y_TOFF            8
906
+
907
+    #define Y2_IHOLD         31
908
+    #define Y2_IRUN          31
909
+    #define Y2_IHOLDDELAY    15
910
+    #define Y2_I_SCALE_ANALOG 1
911
+    #define Y2_MRES          16
912
+    #define Y2_TBL            1
913
+    #define Y2_TOFF           8
914
+
915
+    #define Z_IHOLD          31
916
+    #define Z_IRUN           31
917
+    #define Z_IHOLDDELAY     15
918
+    #define Z_I_SCALE_ANALOG  1
919
+    #define Z_MRES           16
920
+    #define Z_TBL             1
921
+    #define Z_TOFF            8
922
+
923
+    #define Z2_IHOLD         31
924
+    #define Z2_IRUN          31
925
+    #define Z2_IHOLDDELAY    15
926
+    #define Z2_I_SCALE_ANALOG 1
927
+    #define Z2_MRES          16
928
+    #define Z2_TBL            1
929
+    #define Z2_TOFF           8
930
+
931
+    #define E0_IHOLD         31
932
+    #define E0_IRUN          31
933
+    #define E0_IHOLDDELAY    15
934
+    #define E0_I_SCALE_ANALOG 1
935
+    #define E0_MRES          16
936
+    #define E0_TBL            1
937
+    #define E0_TOFF           8
938
+
939
+    #define E1_IHOLD         31
940
+    #define E1_IRUN          31
941
+    #define E1_IHOLDDELAY    15
942
+    #define E1_I_SCALE_ANALOG 1
943
+    #define E1_MRES          16
944
+    #define E1_TBL            1
945
+    #define E1_TOFF           8
946
+
947
+    #define E2_IHOLD         31
948
+    #define E2_IRUN          31
949
+    #define E2_IHOLDDELAY    15
950
+    #define E2_I_SCALE_ANALOG 1
951
+    #define E2_MRES          16
952
+    #define E2_TBL            1
953
+    #define E2_TOFF           8
954
+
955
+    #define E3_IHOLD         31
956
+    #define E3_IRUN          31
957
+    #define E3_IHOLDDELAY    15
958
+    #define E3_I_SCALE_ANALOG 1
959
+    #define E3_MRES          16
960
+    #define E3_TBL            1
961
+    #define E3_TOFF           8
962
+
963
+  #endif // TMC2130_ADVANCED_CONFIGURATION
964
+
965
+#endif // HAVE_TMC2130DRIVER
966
+
967
+// @section L6470
968
+
969
+
970
+/**
971
+ * Enable this section if you have L6470 motor drivers.
972
+ * You need to import the L6470 library into the Arduino IDE for this.
973
+ * (https://github.com/ameyer/Arduino-L6470)
974
+ */
765 975
 
766 976
 //#define HAVE_L6470DRIVER
767 977
 #if ENABLED(HAVE_L6470DRIVER)
768 978
 
769 979
   //#define X_IS_L6470
770
-  #define X_MICROSTEPS 16     //number of microsteps
771
-  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
772
-  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
773
-  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
774
-
775 980
   //#define X2_IS_L6470
776
-  #define X2_MICROSTEPS 16     //number of microsteps
777
-  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
778
-  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
779
-  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
780
-
781 981
   //#define Y_IS_L6470
782
-  #define Y_MICROSTEPS 16     //number of microsteps
783
-  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
784
-  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
785
-  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
786
-
787 982
   //#define Y2_IS_L6470
788
-  #define Y2_MICROSTEPS 16     //number of microsteps
789
-  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
790
-  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
791
-  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
792
-
793 983
   //#define Z_IS_L6470
794
-  #define Z_MICROSTEPS 16     //number of microsteps
795
-  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
796
-  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
797
-  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
798
-
799 984
   //#define Z2_IS_L6470
800
-  #define Z2_MICROSTEPS 16     //number of microsteps
801
-  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
802
-  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
803
-  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
804
-
805 985
   //#define E0_IS_L6470
806
-  #define E0_MICROSTEPS 16     //number of microsteps
807
-  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
808
-  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
809
-  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
810
-
811 986
   //#define E1_IS_L6470
812
-  #define E1_MICROSTEPS 16     //number of microsteps
813
-  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
814
-  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
815
-  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
816
-
817 987
   //#define E2_IS_L6470
818
-  #define E2_MICROSTEPS 16     //number of microsteps
819
-  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
820
-  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
821
-  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
822
-
823 988
   //#define E3_IS_L6470
824
-  #define E3_MICROSTEPS 16     //number of microsteps
825
-  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be careful not to go too high
826
-  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
827
-  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
989
+
990
+  #define X_MICROSTEPS      16 // number of microsteps
991
+  #define X_K_VAL           50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
992
+  #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
993
+  #define X_STALLCURRENT  1500 // current in mA where the driver will detect a stall
994
+
995
+  #define X2_MICROSTEPS     16
996
+  #define X2_K_VAL          50
997
+  #define X2_OVERCURRENT  2000
998
+  #define X2_STALLCURRENT 1500
999
+
1000
+  #define Y_MICROSTEPS      16
1001
+  #define Y_K_VAL           50
1002
+  #define Y_OVERCURRENT   2000
1003
+  #define Y_STALLCURRENT  1500
1004
+
1005
+  #define Y2_MICROSTEPS     16
1006
+  #define Y2_K_VAL          50
1007
+  #define Y2_OVERCURRENT  2000
1008
+  #define Y2_STALLCURRENT 1500
1009
+
1010
+  #define Z_MICROSTEPS      16
1011
+  #define Z_K_VAL           50
1012
+  #define Z_OVERCURRENT   2000
1013
+  #define Z_STALLCURRENT  1500
1014
+
1015
+  #define Z2_MICROSTEPS     16
1016
+  #define Z2_K_VAL          50
1017
+  #define Z2_OVERCURRENT  2000
1018
+  #define Z2_STALLCURRENT 1500
1019
+
1020
+  #define E0_MICROSTEPS     16
1021
+  #define E0_K_VAL          50
1022
+  #define E0_OVERCURRENT  2000
1023
+  #define E0_STALLCURRENT 1500
1024
+
1025
+  #define E1_MICROSTEPS     16
1026
+  #define E1_K_VAL          50
1027
+  #define E1_OVERCURRENT  2000
1028
+  #define E1_STALLCURRENT 1500
1029
+
1030
+  #define E2_MICROSTEPS     16
1031
+  #define E2_K_VAL          50
1032
+  #define E2_OVERCURRENT  2000
1033
+  #define E2_STALLCURRENT 1500
1034
+
1035
+  #define E3_MICROSTEPS     16
1036
+  #define E3_K_VAL          50
1037
+  #define E3_OVERCURRENT  2000
1038
+  #define E3_STALLCURRENT 1500
828 1039
 
829 1040
 #endif
830 1041
 

+ 5
- 0
Marlin/pins_RAMPS.h View File

@@ -93,22 +93,27 @@
93 93
 #define X_STEP_PIN         54
94 94
 #define X_DIR_PIN          55
95 95
 #define X_ENABLE_PIN       38
96
+#define X_CS_PIN           53
96 97
 
97 98
 #define Y_STEP_PIN         60
98 99
 #define Y_DIR_PIN          61
99 100
 #define Y_ENABLE_PIN       56
101
+#define Y_CS_PIN           49
100 102
 
101 103
 #define Z_STEP_PIN         46
102 104
 #define Z_DIR_PIN          48
103 105
 #define Z_ENABLE_PIN       62
106
+#define Z_CS_PIN           40
104 107
 
105 108
 #define E0_STEP_PIN        26
106 109
 #define E0_DIR_PIN         28
107 110
 #define E0_ENABLE_PIN      24
111
+#define E0_CS_PIN          42
108 112
 
109 113
 #define E1_STEP_PIN        36
110 114
 #define E1_DIR_PIN         34
111 115
 #define E1_ENABLE_PIN      30
116
+#define E1_CS_PIN          44
112 117
 
113 118
 //
114 119
 // Temperature Sensors

+ 5
- 0
Marlin/stepper.cpp View File

@@ -789,6 +789,11 @@ void Stepper::init() {
789 789
     tmc_init();
790 790
   #endif
791 791
 
792
+  // Init TMC2130 Steppers
793
+  #if ENABLED(HAVE_TMC2130DRIVER)
794
+    tmc2130_init();
795
+  #endif
796
+
792 797
   // Init L6470 Steppers
793 798
   #if ENABLED(HAVE_L6470DRIVER)
794 799
     L6470_init();

+ 538
- 149
Marlin/stepper_indirection.cpp View File

@@ -45,201 +45,590 @@
45 45
 
46 46
 #include "MarlinConfig.h"
47 47
 
48
+//
49
+// TMC26X Driver objects and inits
50
+//
48 51
 #if ENABLED(HAVE_TMCDRIVER)
52
+
49 53
   #include <SPI.h>
50 54
   #include <TMC26XStepper.h>
51
-#endif
52
-
53
-// Stepper objects of TMC steppers used
54
-#if ENABLED(X_IS_TMC)
55
-  TMC26XStepper stepperX(200, X_ENABLE_PIN, X_STEP_PIN, X_DIR_PIN, X_MAX_CURRENT, X_SENSE_RESISTOR);
56
-#endif
57
-#if ENABLED(X2_IS_TMC)
58
-  TMC26XStepper stepperX2(200, X2_ENABLE_PIN, X2_STEP_PIN, X2_DIR_PIN, X2_MAX_CURRENT, X2_SENSE_RESISTOR);
59
-#endif
60
-#if ENABLED(Y_IS_TMC)
61
-  TMC26XStepper stepperY(200, Y_ENABLE_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_MAX_CURRENT, Y_SENSE_RESISTOR);
62
-#endif
63
-#if ENABLED(Y2_IS_TMC)
64
-  TMC26XStepper stepperY2(200, Y2_ENABLE_PIN, Y2_STEP_PIN, Y2_DIR_PIN, Y2_MAX_CURRENT, Y2_SENSE_RESISTOR);
65
-#endif
66
-#if ENABLED(Z_IS_TMC)
67
-  TMC26XStepper stepperZ(200, Z_ENABLE_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_MAX_CURRENT, Z_SENSE_RESISTOR);
68
-#endif
69
-#if ENABLED(Z2_IS_TMC)
70
-  TMC26XStepper stepperZ2(200, Z2_ENABLE_PIN, Z2_STEP_PIN, Z2_DIR_PIN, Z2_MAX_CURRENT, Z2_SENSE_RESISTOR);
71
-#endif
72
-#if ENABLED(E0_IS_TMC)
73
-  TMC26XStepper stepperE0(200, E0_ENABLE_PIN, E0_STEP_PIN, E0_DIR_PIN, E0_MAX_CURRENT, E0_SENSE_RESISTOR);
74
-#endif
75
-#if ENABLED(E1_IS_TMC)
76
-  TMC26XStepper stepperE1(200, E1_ENABLE_PIN, E1_STEP_PIN, E1_DIR_PIN, E1_MAX_CURRENT, E1_SENSE_RESISTOR);
77
-#endif
78
-#if ENABLED(E2_IS_TMC)
79
-  TMC26XStepper stepperE2(200, E2_ENABLE_PIN, E2_STEP_PIN, E2_DIR_PIN, E2_MAX_CURRENT, E2_SENSE_RESISTOR);
80
-#endif
81
-#if ENABLED(E3_IS_TMC)
82
-  TMC26XStepper stepperE3(200, E3_ENABLE_PIN, E3_STEP_PIN, E3_DIR_PIN, E3_MAX_CURRENT, E3_SENSE_RESISTOR);
83
-#endif
84 55
 
85
-#if ENABLED(HAVE_TMCDRIVER)
86
-void tmc_init() {
87 56
   #if ENABLED(X_IS_TMC)
88
-    stepperX.setMicrosteps(X_MICROSTEPS);
89
-    stepperX.start();
57
+    TMC26XStepper stepperX(200, X_ENABLE_PIN, X_STEP_PIN, X_DIR_PIN, X_MAX_CURRENT, X_SENSE_RESISTOR);
90 58
   #endif
91 59
   #if ENABLED(X2_IS_TMC)
92
-    stepperX2.setMicrosteps(X2_MICROSTEPS);
93
-    stepperX2.start();
60
+    TMC26XStepper stepperX2(200, X2_ENABLE_PIN, X2_STEP_PIN, X2_DIR_PIN, X2_MAX_CURRENT, X2_SENSE_RESISTOR);
94 61
   #endif
95 62
   #if ENABLED(Y_IS_TMC)
96
-    stepperY.setMicrosteps(Y_MICROSTEPS);
97
-    stepperY.start();
63
+    TMC26XStepper stepperY(200, Y_ENABLE_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_MAX_CURRENT, Y_SENSE_RESISTOR);
98 64
   #endif
99 65
   #if ENABLED(Y2_IS_TMC)
100
-    stepperY2.setMicrosteps(Y2_MICROSTEPS);
101
-    stepperY2.start();
66
+    TMC26XStepper stepperY2(200, Y2_ENABLE_PIN, Y2_STEP_PIN, Y2_DIR_PIN, Y2_MAX_CURRENT, Y2_SENSE_RESISTOR);
102 67
   #endif
103 68
   #if ENABLED(Z_IS_TMC)
104
-    stepperZ.setMicrosteps(Z_MICROSTEPS);
105
-    stepperZ.start();
69
+    TMC26XStepper stepperZ(200, Z_ENABLE_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_MAX_CURRENT, Z_SENSE_RESISTOR);
106 70
   #endif
107 71
   #if ENABLED(Z2_IS_TMC)
108
-    stepperZ2.setMicrosteps(Z2_MICROSTEPS);
109
-    stepperZ2.start();
72
+    TMC26XStepper stepperZ2(200, Z2_ENABLE_PIN, Z2_STEP_PIN, Z2_DIR_PIN, Z2_MAX_CURRENT, Z2_SENSE_RESISTOR);
110 73
   #endif
111 74
   #if ENABLED(E0_IS_TMC)
112
-    stepperE0.setMicrosteps(E0_MICROSTEPS);
113
-    stepperE0.start();
75
+    TMC26XStepper stepperE0(200, E0_ENABLE_PIN, E0_STEP_PIN, E0_DIR_PIN, E0_MAX_CURRENT, E0_SENSE_RESISTOR);
114 76
   #endif
115 77
   #if ENABLED(E1_IS_TMC)
116
-    stepperE1.setMicrosteps(E1_MICROSTEPS);
117
-    stepperE1.start();
78
+    TMC26XStepper stepperE1(200, E1_ENABLE_PIN, E1_STEP_PIN, E1_DIR_PIN, E1_MAX_CURRENT, E1_SENSE_RESISTOR);
118 79
   #endif
119 80
   #if ENABLED(E2_IS_TMC)
120
-    stepperE2.setMicrosteps(E2_MICROSTEPS);
121
-    stepperE2.start();
81
+    TMC26XStepper stepperE2(200, E2_ENABLE_PIN, E2_STEP_PIN, E2_DIR_PIN, E2_MAX_CURRENT, E2_SENSE_RESISTOR);
122 82
   #endif
123 83
   #if ENABLED(E3_IS_TMC)
124
-    stepperE3.setMicrosteps(E3_MICROSTEPS);
125
-    stepperE3.start();
84
+    TMC26XStepper stepperE3(200, E3_ENABLE_PIN, E3_STEP_PIN, E3_DIR_PIN, E3_MAX_CURRENT, E3_SENSE_RESISTOR);
126 85
   #endif
127
-}
128
-#endif
129 86
 
130
-// L6470 Driver objects and inits
87
+  #define _TMC_INIT(A) do{ \
88
+    stepper##A.setMicrosteps(A##_MICROSTEPS);
89
+    stepper##A.start();
90
+  } while(0)
91
+
92
+  void tmc_init() {
93
+    #if ENABLED(X_IS_TMC)
94
+      _TMC_INIT(X);
95
+    #endif
96
+    #if ENABLED(X2_IS_TMC)
97
+      _TMC_INIT(X2);
98
+    #endif
99
+    #if ENABLED(Y_IS_TMC)
100
+      _TMC_INIT(Y);
101
+    #endif
102
+    #if ENABLED(Y2_IS_TMC)
103
+      _TMC_INIT(Y2);
104
+    #endif
105
+    #if ENABLED(Z_IS_TMC)
106
+      _TMC_INIT(Z);
107
+    #endif
108
+    #if ENABLED(Z2_IS_TMC)
109
+      _TMC_INIT(Z2);
110
+    #endif
111
+    #if ENABLED(E0_IS_TMC)
112
+      _TMC_INIT(E0);
113
+    #endif
114
+    #if ENABLED(E1_IS_TMC)
115
+      _TMC_INIT(E1);
116
+    #endif
117
+    #if ENABLED(E2_IS_TMC)
118
+      _TMC_INIT(E2);
119
+    #endif
120
+    #if ENABLED(E3_IS_TMC)
121
+      _TMC_INIT(E3);
122
+    #endif
123
+  }
124
+
125
+#endif // HAVE_TMCDRIVER
126
+
127
+//
128
+// TMC2130 Driver objects and inits
129
+//
130
+#if ENABLED(HAVE_TMC2130DRIVER)
131
+
132
+  #include <SPI.h>
133
+  #include <Trinamic_TMC2130.h>
134
+
135
+  #if ENABLED(TMC2130_ADVANCED_CONFIGURATION)
131 136
 
137
+    #ifdef GLOBAL_I_SCALE_ANALOG
138
+      #define _2130_set_I_scale_analog(A) stepper##A.set_I_scale_analog(GLOBAL_I_SCALE_ANALOG)
139
+    #else
140
+      #define _2130_set_I_scale_analog(A) NOOP
141
+    #endif
142
+    #ifdef GLOBAL_INTERNAL_RSENSE
143
+      #define _2130_set_internal_Rsense(A) stepper##A.set_internal_Rsense(GLOBAL_INTERNAL_RSENSE)
144
+    #else
145
+      #define _2130_set_internal_Rsense(A) NOOP
146
+    #endif
147
+    #ifdef GLOBAL_EN_PWM_MODE
148
+      #define _2130_set_en_pwm_mode(A) stepper##A.set_en_pwm_mode(GLOBAL_EN_PWM_MODE)
149
+    #else
150
+      #define _2130_set_en_pwm_mode(A) NOOP
151
+    #endif
152
+    #ifdef GLOBAL_ENC_COMMUTATION
153
+      #define _2130_set_enc_commutation(A) stepper##A.set_enc_commutation(GLOBAL_ENC_COMMUTATION)
154
+    #else
155
+      #define _2130_set_enc_commutation(A) NOOP
156
+    #endif
157
+    #ifdef GLOBAL_SHAFT
158
+      #define _2130_set_shaft(A) stepper##A.set_shaft(GLOBAL_SHAFT)
159
+    #else
160
+      #define _2130_set_shaft(A) NOOP
161
+    #endif
162
+    #ifdef GLOBAL_DIAG0_ERROR
163
+      #define _2130_set_diag0_error(A) stepper##A.set_diag0_error(GLOBAL_DIAG0_ERROR)
164
+    #else
165
+      #define _2130_set_diag0_error(A) NOOP
166
+    #endif
167
+    #ifdef GLOBAL_DIAG0_OTPW
168
+      #define _2130_set_diag0_otpw(A) stepper##A.set_diag0_otpw(GLOBAL_DIAG0_OTPW)
169
+    #else
170
+      #define _2130_set_diag0_otpw(A) NOOP
171
+    #endif
172
+    #ifdef GLOBAL_DIAG0_STALL
173
+      #define _2130_set_diag0_stall(A) stepper##A.set_diag0_stall(GLOBAL_DIAG0_STALL)
174
+    #else
175
+      #define _2130_set_diag0_stall(A) NOOP
176
+    #endif
177
+    #ifdef GLOBAL_DIAG1_STALL
178
+      #define _2130_set_diag1_stall(A) stepper##A.set_diag1_stall(GLOBAL_DIAG1_STALL)
179
+    #else
180
+      #define _2130_set_diag1_stall(A) NOOP
181
+    #endif
182
+    #ifdef GLOBAL_DIAG1_INDEX
183
+      #define _2130_set_diag1_index(A) stepper##A.set_diag1_index(GLOBAL_DIAG1_INDEX)
184
+    #else
185
+      #define _2130_set_diag1_index(A) NOOP
186
+    #endif
187
+    #ifdef GLOBAL_DIAG1_ONSTATE
188
+      #define _2130_set_diag1_onstate(A) stepper##A.set_diag1_onstate(GLOBAL_DIAG1_ONSTATE)
189
+    #else
190
+      #define _2130_set_diag1_onstate(A) NOOP
191
+    #endif
192
+    #ifdef GLOBAL_DIAG1_ONSTATE
193
+      #define _2130_set_diag1_steps_skipped(A) stepper##A.set_diag1_steps_skipped(GLOBAL_DIAG1_ONSTATE)
194
+    #else
195
+      #define _2130_set_diag1_steps_skipped(A) NOOP
196
+    #endif
197
+    #ifdef GLOBAL_DIAG0_INT_PUSHPULL
198
+      #define _2130_set_diag0_int_pushpull(A) stepper##A.set_diag0_int_pushpull(GLOBAL_DIAG0_INT_PUSHPULL)
199
+    #else
200
+      #define _2130_set_diag0_int_pushpull(A) NOOP
201
+    #endif
202
+    #ifdef GLOBAL_DIAG1_INT_PUSHPULL
203
+      #define _2130_set_diag1_int_pushpull(A) stepper##A.set_diag1_int_pushpull(GLOBAL_DIAG1_INT_PUSHPULL)
204
+    #else
205
+      #define _2130_set_diag1_int_pushpull(A) NOOP
206
+    #endif
207
+    #ifdef GLOBAL_SMALL_HYSTERESIS
208
+      #define _2130_set_small_hysteresis(A) stepper##A.set_small_hysteresis(GLOBAL_SMALL_HYSTERESIS)
209
+    #else
210
+      #define _2130_set_small_hysteresis(A) NOOP
211
+    #endif
212
+    #ifdef GLOBAL_STOP_ENABLE
213
+      #define _2130_set_stop_enable(A) stepper##A.set_stop_enable(GLOBAL_STOP_ENABLE)
214
+    #else
215
+      #define _2130_set_stop_enable(A) NOOP
216
+    #endif
217
+    #ifdef GLOBAL_DIRECT_MODE
218
+      #define _2130_set_direct_mode(A) stepper##A.set_direct_mode(GLOBAL_DIRECT_MODE)
219
+    #else
220
+      #define _2130_set_direct_mode(A) NOOP
221
+    #endif
222
+    #if defined(GLOBAL_IHOLD) && defined(GLOBAL_IRUN) && defined(GLOBAL_IHOLDDELAY)
223
+      #define _2130_set_IHOLD_IRUN(A) stepper##A.set_IHOLD_IRUN(GLOBAL_IHOLD, GLOBAL_IRUN, GLOBAL_IHOLDDELAY)
224
+    #else
225
+      #define _2130_set_IHOLD_IRUN(A) NOOP
226
+    #endif
227
+    #ifdef GLOBAL_TPOWERDOWN
228
+      #define _2130_set_TPOWERDOWN(A) stepper##A.set_TPOWERDOWN(GLOBAL_TPOWERDOWN)
229
+    #else
230
+      #define _2130_set_TPOWERDOWN(A) NOOP
231
+    #endif
232
+    #ifdef GLOBAL_TPWMTHRS
233
+      #define _2130_set_TPWMTHRS(A) stepper##A.set_TPWMTHRS(GLOBAL_TPWMTHRS)
234
+    #else
235
+      #define _2130_set_TPWMTHRS(A) NOOP
236
+    #endif
237
+    #ifdef GLOBAL_TCOOLTHRS
238
+      #define _2130_set_TCOOLTHRS(A) stepper##A.set_TCOOLTHRS(GLOBAL_TCOOLTHRS)
239
+    #else
240
+      #define _2130_set_TCOOLTHRS(A) NOOP
241
+    #endif
242
+    #ifdef GLOBAL_THIGH
243
+      #define _2130_set_THIGH(A) stepper##A.set_THIGH(GLOBAL_THIGH)
244
+    #else
245
+      #define _2130_set_THIGH(A) NOOP
246
+    #endif
247
+    #ifdef GLOBAL_XDIRECT
248
+      #define _2130_set_XDIRECT(A) stepper##A.set_XDIRECT(GLOBAL_XDIRECT)
249
+    #else
250
+      #define _2130_set_XDIRECT(A) NOOP
251
+    #endif
252
+    #ifdef GLOBAL_VDCMIN
253
+      #define _2130_set_VDCMIN(A) stepper##A.set_VDCMIN(GLOBAL_VDCMIN)
254
+    #else
255
+      #define _2130_set_VDCMIN(A) NOOP
256
+    #endif
257
+    #ifdef GLOBAL_DEDGE
258
+      #define _2130_set_dedge(A) stepper##A.set_dedge(GLOBAL_DEDGE)
259
+    #else
260
+      #define _2130_set_dedge(A) NOOP
261
+    #endif
262
+    #ifdef GLOBAL_DISS2G
263
+      #define _2130_set_diss2g(A) stepper##A.set_diss2g(GLOBAL_DISS2G)
264
+    #else
265
+      #define _2130_set_diss2g(A) NOOP
266
+    #endif
267
+    #ifdef GLOBAL_INTPOL
268
+      #define _2130_set_intpol(A) stepper##A.set_intpol(GLOBAL_INTPOL)
269
+    #else
270
+      #define _2130_set_intpol(A) NOOP
271
+    #endif
272
+    #ifdef GLOBAL_MRES
273
+      #define _2130_set_mres(A) stepper##A.set_mres(GLOBAL_MRES)
274
+    #else
275
+      #define _2130_set_mres(A) NOOP
276
+    #endif
277
+    #ifdef GLOBAL_SYNC
278
+      #define _2130_set_sync(A) stepper##A.set_sync(GLOBAL_SYNC)
279
+    #else
280
+      #define _2130_set_sync(A) NOOP
281
+    #endif
282
+    #ifdef GLOBAL_VHIGHCHM
283
+      #define _2130_set_vhighchm(A) stepper##A.set_vhighchm(GLOBAL_VHIGHCHM)
284
+    #else
285
+      #define _2130_set_vhighchm(A) NOOP
286
+    #endif
287
+    #ifdef GLOBAL_VHIGHFS
288
+      #define _2130_set_vhighfs(A) stepper##A.set_vhighfs(GLOBAL_VHIGHFS)
289
+    #else
290
+      #define _2130_set_vhighfs(A) NOOP
291
+    #endif
292
+    #ifdef GLOBAL_VSENSE
293
+      #define _2130_set_vsense(A) stepper##A.set_vsense(GLOBAL_VSENSE)
294
+    #else
295
+      #define _2130_set_vsense(A) NOOP
296
+    #endif
297
+    #ifdef GLOBAL_TBL
298
+      #define _2130_set_tbl(A) stepper##A.set_tbl(GLOBAL_TBL)
299
+    #else
300
+      #define _2130_set_tbl(A) NOOP
301
+    #endif
302
+    #ifdef GLOBAL_CHM
303
+      #define _2130_set_chm(A) stepper##A.set_chm(GLOBAL_CHM)
304
+    #else
305
+      #define _2130_set_chm(A) NOOP
306
+    #endif
307
+    #ifdef GLOBAL_RNDTF
308
+      #define _2130_set_rndtf(A) stepper##A.set_rndtf(GLOBAL_RNDTF)
309
+    #else
310
+      #define _2130_set_rndtf(A) NOOP
311
+    #endif
312
+    #ifdef GLOBAL_DISFDCC
313
+      #define _2130_set_disfdcc(A) stepper##A.set_disfdcc(GLOBAL_DISFDCC)
314
+    #else
315
+      #define _2130_set_disfdcc(A) NOOP
316
+    #endif
317
+    #ifdef GLOBAL_FD
318
+      #define _2130_set_fd(A) stepper##A.set_fd(GLOBAL_FD)
319
+    #else
320
+      #define _2130_set_fd(A) NOOP
321
+    #endif
322
+    #ifdef GLOBAL_HEND
323
+      #define _2130_set_hend(A) stepper##A.set_hend(GLOBAL_HEND)
324
+    #else
325
+      #define _2130_set_hend(A) NOOP
326
+    #endif
327
+    #ifdef GLOBAL_HSTRT
328
+      #define _2130_set_hstrt(A) stepper##A.set_hstrt(GLOBAL_HSTRT)
329
+    #else
330
+      #define _2130_set_hstrt(A) NOOP
331
+    #endif
332
+    #ifdef GLOBAL_TOFF
333
+      #define _2130_set_toff(A) stepper##A.set_toff(GLOBAL_TOFF)
334
+    #else
335
+      #define _2130_set_toff(A) NOOP
336
+    #endif
337
+    #ifdef GLOBAL_SFILT
338
+      #define _2130_set_sfilt(A) stepper##A.set_sfilt(GLOBAL_SFILT)
339
+    #else
340
+      #define _2130_set_sfilt(A) NOOP
341
+    #endif
342
+    #ifdef GLOBAL_SGT
343
+      #define _2130_set_sgt(A) stepper##A.set_sgt(GLOBAL_SGT)
344
+    #else
345
+      #define _2130_set_sgt(A) NOOP
346
+    #endif
347
+    #ifdef GLOBAL_SEIMIN
348
+      #define _2130_set_seimin(A) stepper##A.set_seimin(GLOBAL_SEIMIN)
349
+    #else
350
+      #define _2130_set_seimin(A) NOOP
351
+    #endif
352
+    #ifdef GLOBAL_SEDN
353
+      #define _2130_set_sedn(A) stepper##A.set_sedn(GLOBAL_SEDN)
354
+    #else
355
+      #define _2130_set_sedn(A) NOOP
356
+    #endif
357
+    #ifdef GLOBAL_SEMAX
358
+      #define _2130_set_semax(A) stepper##A.set_semax(GLOBAL_SEMAX)
359
+    #else
360
+      #define _2130_set_semax(A) NOOP
361
+    #endif
362
+    #ifdef GLOBAL_SEUP
363
+      #define _2130_set_seup(A) stepper##A.set_seup(GLOBAL_SEUP)
364
+    #else
365
+      #define _2130_set_seup(A) NOOP
366
+    #endif
367
+    #ifdef GLOBAL_SEMIN
368
+      #define _2130_set_semin(A) stepper##A.set_semin(GLOBAL_SEMIN)
369
+    #else
370
+      #define _2130_set_semin(A) NOOP
371
+    #endif
372
+    #if defined(GLOBAL_DC_TIME) && defined(GLOBAL_DC_SG)
373
+      #define _2130_set_DCCTRL(A) stepper##A.set_DCCTRL(GLOBAL_DC_TIME, GLOBAL_DC_SG)
374
+    #else
375
+      #define _2130_set_DCCTRL(A) NOOP
376
+    #endif
377
+    #ifdef GLOBAL_FREEWHEEL
378
+      #define _2130_set_freewheel(A) stepper##A.set_freewheel(GLOBAL_FREEWHEEL)
379
+    #else
380
+      #define _2130_set_freewheel(A) NOOP
381
+    #endif
382
+    #ifdef GLOBAL_PWM_SYMMETRIC
383
+      #define _2130_set_pwm_symmetric(A) stepper##A.set_pwm_symmetric(GLOBAL_PWM_SYMMETRIC)
384
+    #else
385
+      #define _2130_set_pwm_symmetric(A) NOOP
386
+    #endif
387
+    #ifdef GLOBAL_PWM_AUTOSCALE
388
+      #define _2130_set_pwm_autoscale(A) stepper##A.set_pwm_autoscale(GLOBAL_PWM_AUTOSCALE)
389
+    #else
390
+      #define _2130_set_pwm_autoscale(A) NOOP
391
+    #endif
392
+    #ifdef GLOBAL_PWM_FREQ
393
+      #define _2130_set_pwm_freq(A) stepper##A.set_pwm_freq(GLOBAL_PWM_FREQ)
394
+    #else
395
+      #define _2130_set_pwm_freq(A) NOOP
396
+    #endif
397
+    #ifdef GLOBAL_PWM_GRAD
398
+      #define _2130_set_PWM_GRAD(A) stepper##A.set_PWM_GRAD(GLOBAL_PWM_GRAD)
399
+    #else
400
+      #define _2130_set_PWM_GRAD(A) NOOP
401
+    #endif
402
+    #ifdef GLOBAL_PWM_AMPL
403
+      #define _2130_set_PWM_AMPL(A) stepper##A.set_PWM_AMPL(GLOBAL_PWM_AMPL)
404
+    #else
405
+      #define _2130_set_PWM_AMPL(A) NOOP
406
+    #endif
407
+    #ifdef GLOBAL_ENCM_CTRL
408
+      #define _2130_set_ENCM_CTRL(A) stepper##A.set_ENCM_CTRL(GLOBAL_ENCM_CTRL)
409
+    #else
410
+      #define _2130_set_ENCM_CTRL(A) NOOP
411
+    #endif
412
+
413
+    #define _TMC2130_INIT(A) do{ \
414
+      stepper##A.init(); \
415
+      _2130_set_I_scale_analog(A); \
416
+      _2130_set_internal_Rsense(A); \
417
+      _2130_set_en_pwm_mode(A); \
418
+      _2130_set_enc_commutation(A); \
419
+      _2130_set_shaft(A); \
420
+      _2130_set_diag0_error(A); \
421
+      _2130_set_diag0_otpw(A); \
422
+      _2130_set_diag0_stall(A); \
423
+      _2130_set_diag1_stall(A); \
424
+      _2130_set_diag1_index(A); \
425
+      _2130_set_diag1_onstate(A); \
426
+      _2130_set_diag1_steps_skipped(A); \
427
+      _2130_set_diag0_int_pushpull(A); \
428
+      _2130_set_diag1_int_pushpull(A); \
429
+      _2130_set_small_hysteresis(A); \
430
+      _2130_set_stop_enable(A); \
431
+      _2130_set_direct_mode(A); \
432
+      _2130_set_IHOLD_IRUN(A); \
433
+      _2130_set_TPOWERDOWN(A); \
434
+      _2130_set_TPWMTHRS(A); \
435
+      _2130_set_TCOOLTHRS(A); \
436
+      _2130_set_THIGH(A); \
437
+      _2130_set_XDIRECT(A); \
438
+      _2130_set_VDCMIN(A); \
439
+      _2130_set_dedge(A); \
440
+      _2130_set_diss2g(A); \
441
+      _2130_set_intpol(A); \
442
+      _2130_set_mres(A); \
443
+      _2130_set_sync(A); \
444
+      _2130_set_vhighchm(A); \
445
+      _2130_set_vhighfs(A); \
446
+      _2130_set_vsense(A); \
447
+      _2130_set_tbl(A); \
448
+      _2130_set_chm(A); \
449
+      _2130_set_rndtf(A); \
450
+      _2130_set_disfdcc(A); \
451
+      _2130_set_fd(A); \
452
+      _2130_set_hend(A); \
453
+      _2130_set_hstrt(A); \
454
+      _2130_set_toff(A); \
455
+      _2130_set_sfilt(A); \
456
+      _2130_set_sgt(A); \
457
+      _2130_set_seimin(A); \
458
+      _2130_set_sedn(A); \
459
+      _2130_set_semax(A); \
460
+      _2130_set_seup(A); \
461
+      _2130_set_semin(A); \
462
+      _2130_set_DCCTRL(A); \
463
+      _2130_set_freewheel(A); \
464
+      _2130_set_pwm_symmetric(A); \
465
+      _2130_set_pwm_autoscale(A); \
466
+      _2130_set_pwm_freq(A); \
467
+      _2130_set_PWM_GRAD(A); \
468
+      _2130_set_PWM_AMPL(A); \
469
+      _2130_set_ENCM_CTRL(A); \
470
+    } while(0)
471
+
472
+  #else // !TMC2130_ADVANCED_CONFIGURATION
473
+
474
+    #define _TMC2130_INIT(A) do{ \
475
+      stepper##A.init(); \
476
+      stepper##A.set_mres(A##_MRES); \
477
+      stepper##A.set_IHOLD_IRUN(A##_IHOLD, A##_IRUN, A##_IHOLDDELAY); \
478
+      stepper##A.set_I_scale_analog(A##_I_SCALE_ANALOG); \
479
+      stepper##A.set_tbl(A##_TBL); \
480
+      stepper##A.set_toff(A##_TOFF); \
481
+    } while(0)
482
+
483
+  #endif // TMC2130_ADVANCED_CONFIGURATION
484
+
485
+  // Stepper objects of TMC2310 steppers used
486
+  #if ENABLED(X_IS_TMC2130)
487
+    Trinamic_TMC2130 stepperX(X_CS_PIN);
488
+  #endif
489
+  #if ENABLED(X2_IS_TMC2130)
490
+    Trinamic_TMC2130 stepperX2(X2_CS_PIN);
491
+  #endif
492
+  #if ENABLED(Y_IS_TMC2130)
493
+    Trinamic_TMC2130 stepperY(Y_CS_PIN);
494
+  #endif
495
+  #if ENABLED(Y2_IS_TMC2130)
496
+    Trinamic_TMC2130 stepperY2(Y2_CS_PINR);
497
+  #endif
498
+  #if ENABLED(Z_IS_TMC2130)
499
+    Trinamic_TMC2130 stepperZ(Z_CS_PIN);
500
+  #endif
501
+  #if ENABLED(Z2_IS_TMC2130)
502
+    Trinamic_TMC2130 stepperZ2(Z2_CS_PIN);
503
+  #endif
504
+  #if ENABLED(E0_IS_TMC2130)
505
+    Trinamic_TMC2130 stepperE0(E0_CS_PIN);
506
+  #endif
507
+  #if ENABLED(E1_IS_TMC2130)
508
+    Trinamic_TMC2130 stepperE1(E1_CS_PIN);
509
+  #endif
510
+  #if ENABLED(E2_IS_TMC2130)
511
+    Trinamic_TMC2130 stepperE2(E2_CS_PIN);
512
+  #endif
513
+  #if ENABLED(E3_IS_TMC2130)
514
+    Trinamic_TMC2130 stepperE3(E3_CS_PIN);
515
+  #endif
516
+
517
+  void tmc2130_init() {
518
+    #if ENABLED(X_IS_TMC2130)
519
+      _TMC2130_INIT(X);
520
+    #endif
521
+    #if ENABLED(X2_IS_TMC2130)
522
+      _TMC2130_INIT(X2);
523
+    #endif
524
+    #if ENABLED(Y_IS_TMC2130)
525
+      _TMC2130_INIT(Y);
526
+    #endif
527
+    #if ENABLED(Y2_IS_TMC2130)
528
+      _TMC2130_INIT(Y2);
529
+    #endif
530
+    #if ENABLED(Z_IS_TMC2130)
531
+      _TMC2130_INIT(Z);
532
+    #endif
533
+    #if ENABLED(Z2_IS_TMC2130)
534
+      _TMC2130_INIT(Z2);
535
+    #endif
536
+    #if ENABLED(E0_IS_TMC2130)
537
+      _TMC2130_INIT(E0);
538
+    #endif
539
+    #if ENABLED(E1_IS_TMC2130)
540
+      _TMC2130_INIT(E1);
541
+    #endif
542
+    #if ENABLED(E2_IS_TMC2130)
543
+      _TMC2130_INIT(E2);
544
+    #endif
545
+    #if ENABLED(E3_IS_TMC2130)
546
+      _TMC2130_INIT(E3);
547
+    #endif
548
+  }
549
+
550
+#endif // HAVE_TMC2130DRIVER
551
+
552
+//
553
+// L6470 Driver objects and inits
554
+//
132 555
 #if ENABLED(HAVE_L6470DRIVER)
556
+
133 557
   #include <SPI.h>
134 558
   #include <L6470.h>
135
-#endif
136
-
137
-// L6470 Stepper objects
138
-#if ENABLED(X_IS_L6470)
139
-  L6470 stepperX(X_ENABLE_PIN);
140
-#endif
141
-#if ENABLED(X2_IS_L6470)
142
-  L6470 stepperX2(X2_ENABLE_PIN);
143
-#endif
144
-#if ENABLED(Y_IS_L6470)
145
-  L6470 stepperY(Y_ENABLE_PIN);
146
-#endif
147
-#if ENABLED(Y2_IS_L6470)
148
-  L6470 stepperY2(Y2_ENABLE_PIN);
149
-#endif
150
-#if ENABLED(Z_IS_L6470)
151
-  L6470 stepperZ(Z_ENABLE_PIN);
152
-#endif
153
-#if ENABLED(Z2_IS_L6470)
154
-  L6470 stepperZ2(Z2_ENABLE_PIN);
155
-#endif
156
-#if ENABLED(E0_IS_L6470)
157
-  L6470 stepperE0(E0_ENABLE_PIN);
158
-#endif
159
-#if ENABLED(E1_IS_L6470)
160
-  L6470 stepperE1(E1_ENABLE_PIN);
161
-#endif
162
-#if ENABLED(E2_IS_L6470)
163
-  L6470 stepperE2(E2_ENABLE_PIN);
164
-#endif
165
-#if ENABLED(E3_IS_L6470)
166
-  L6470 stepperE3(E3_ENABLE_PIN);
167
-#endif
168
-
169
-
170
-// init routine
171
-#if ENABLED(HAVE_L6470DRIVER)
172
-void L6470_init() {
559
+
560
+  // L6470 Stepper objects
173 561
   #if ENABLED(X_IS_L6470)
174
-    stepperX.init(X_K_VAL);
175
-    stepperX.softFree();
176
-    stepperX.setMicroSteps(X_MICROSTEPS);
177
-    stepperX.setOverCurrent(X_OVERCURRENT); //set overcurrent protection
178
-    stepperX.setStallCurrent(X_STALLCURRENT);
562
+    L6470 stepperX(X_ENABLE_PIN);
179 563
   #endif
180 564
   #if ENABLED(X2_IS_L6470)
181
-    stepperX2.init(X2_K_VAL);
182
-    stepperX2.softFree();
183
-    stepperX2.setMicroSteps(X2_MICROSTEPS);
184
-    stepperX2.setOverCurrent(X2_OVERCURRENT); //set overcurrent protection
185
-    stepperX2.setStallCurrent(X2_STALLCURRENT);
565
+    L6470 stepperX2(X2_ENABLE_PIN);
186 566
   #endif
187 567
   #if ENABLED(Y_IS_L6470)
188
-    stepperY.init(Y_K_VAL);
189
-    stepperY.softFree();
190
-    stepperY.setMicroSteps(Y_MICROSTEPS);
191
-    stepperY.setOverCurrent(Y_OVERCURRENT); //set overcurrent protection
192
-    stepperY.setStallCurrent(Y_STALLCURRENT);
568
+    L6470 stepperY(Y_ENABLE_PIN);
193 569
   #endif
194 570
   #if ENABLED(Y2_IS_L6470)
195
-    stepperY2.init(Y2_K_VAL);
196
-    stepperY2.softFree();
197
-    stepperY2.setMicroSteps(Y2_MICROSTEPS);
198
-    stepperY2.setOverCurrent(Y2_OVERCURRENT); //set overcurrent protection
199
-    stepperY2.setStallCurrent(Y2_STALLCURRENT);
571
+    L6470 stepperY2(Y2_ENABLE_PIN);
200 572
   #endif
201 573
   #if ENABLED(Z_IS_L6470)
202
-    stepperZ.init(Z_K_VAL);
203
-    stepperZ.softFree();
204
-    stepperZ.setMicroSteps(Z_MICROSTEPS);
205
-    stepperZ.setOverCurrent(Z_OVERCURRENT); //set overcurrent protection
206
-    stepperZ.setStallCurrent(Z_STALLCURRENT);
574
+    L6470 stepperZ(Z_ENABLE_PIN);
207 575
   #endif
208 576
   #if ENABLED(Z2_IS_L6470)
209
-    stepperZ2.init(Z2_K_VAL);
210
-    stepperZ2.softFree();
211
-    stepperZ2.setMicroSteps(Z2_MICROSTEPS);
212
-    stepperZ2.setOverCurrent(Z2_OVERCURRENT); //set overcurrent protection
213
-    stepperZ2.setStallCurrent(Z2_STALLCURRENT);
577
+    L6470 stepperZ2(Z2_ENABLE_PIN);
214 578
   #endif
215 579
   #if ENABLED(E0_IS_L6470)
216
-    stepperE0.init(E0_K_VAL);
217
-    stepperE0.softFree();
218
-    stepperE0.setMicroSteps(E0_MICROSTEPS);
219
-    stepperE0.setOverCurrent(E0_OVERCURRENT); //set overcurrent protection
220
-    stepperE0.setStallCurrent(E0_STALLCURRENT);
580
+    L6470 stepperE0(E0_ENABLE_PIN);
221 581
   #endif
222 582
   #if ENABLED(E1_IS_L6470)
223
-    stepperE1.init(E1_K_VAL);
224
-    stepperE1.softFree();
225
-    stepperE1.setMicroSteps(E1_MICROSTEPS);
226
-    stepperE1.setOverCurrent(E1_OVERCURRENT); //set overcurrent protection
227
-    stepperE1.setStallCurrent(E1_STALLCURRENT);
583
+    L6470 stepperE1(E1_ENABLE_PIN);
228 584
   #endif
229 585
   #if ENABLED(E2_IS_L6470)
230
-    stepperE2.init(E2_K_VAL);
231
-    stepperE2.softFree();
232
-    stepperE2.setMicroSteps(E2_MICROSTEPS);
233
-    stepperE2.setOverCurrent(E2_OVERCURRENT); //set overcurrent protection
234
-    stepperE2.setStallCurrent(E2_STALLCURRENT);
586
+    L6470 stepperE2(E2_ENABLE_PIN);
235 587
   #endif
236 588
   #if ENABLED(E3_IS_L6470)
237
-    stepperE3.init(E3_K_VAL);
238
-    stepperE3.softFree();
239
-    stepperE3.setMicroSteps(E3_MICROSTEPS);
240
-    stepperE3.setOverCurrent(E3_OVERCURRENT); //set overcurrent protection
241
-    stepperE3.setStallCurrent(E3_STALLCURRENT);
242
-  #endif
243
-}
244
-#endif
589
+    L6470 stepperE3(E3_ENABLE_PIN);
590
+  #endif
591
+
592
+  #define _L6470_INIT(A) do{ \
593
+    stepper##A.init(A##_K_VAL); \
594
+    stepper##A.softFree(); \
595
+    stepper##A.setMicroSteps(A##_MICROSTEPS); \
596
+    stepper##A.setOverCurrent(A##_OVERCURRENT); \
597
+    stepper##A.setStallCurrent(A##_STALLCURRENT); \
598
+  } while(0)
599
+
600
+  void L6470_init() {
601
+    #if ENABLED(X_IS_L6470)
602
+      _L6470_INIT(X);
603
+    #endif
604
+    #if ENABLED(X2_IS_L6470)
605
+      _L6470_INIT(X2);
606
+    #endif
607
+    #if ENABLED(Y_IS_L6470)
608
+      _L6470_INIT(Y);
609
+    #endif
610
+    #if ENABLED(Y2_IS_L6470)
611
+      _L6470_INIT(Y2);
612
+    #endif
613
+    #if ENABLED(Z_IS_L6470)
614
+      _L6470_INIT(Z);
615
+    #endif
616
+    #if ENABLED(Z2_IS_L6470)
617
+      _L6470_INIT(Z2);
618
+    #endif
619
+    #if ENABLED(E0_IS_L6470)
620
+      _L6470_INIT(E0);
621
+    #endif
622
+    #if ENABLED(E1_IS_L6470)
623
+      _L6470_INIT(E1);
624
+    #endif
625
+    #if ENABLED(E2_IS_L6470)
626
+      _L6470_INIT(E2);
627
+    #endif
628
+    #if ENABLED(E3_IS_L6470)
629
+      _L6470_INIT(E3);
630
+    #endif
631
+  }
632
+
633
+#endif // HAVE_L6470DRIVER
245 634
 

+ 37
- 0
Marlin/stepper_indirection.h View File

@@ -53,6 +53,13 @@
53 53
   void tmc_init();
54 54
 #endif
55 55
 
56
+// TMC130 drivers have STEP/DIR/ENABLE on normal pins
57
+#if ENABLED(HAVE_TMC2130DRIVER)
58
+  #include <SPI.h>
59
+  #include <Trinamic_TMC2130.h>
60
+  void tmc2130_init();
61
+#endif
62
+
56 63
 // L6470 has STEP on normal pins, but DIR/ENABLE via SPI
57 64
 #if ENABLED(HAVE_L6470DRIVER)
58 65
   #include <SPI.h>
@@ -76,6 +83,9 @@
76 83
     #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
77 84
     #define X_ENABLE_READ stepperX.isEnabled()
78 85
   #else
86
+    #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(X_IS_TMC2130)
87
+      extern Trinamic_TMC2130 stepperX;
88
+    #endif
79 89
     #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN)
80 90
     #define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE)
81 91
     #define X_ENABLE_READ READ(X_ENABLE_PIN)
@@ -104,6 +114,9 @@
104 114
     #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE)
105 115
     #define Y_ENABLE_READ stepperY.isEnabled()
106 116
   #else
117
+    #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(Y_IS_TMC2130)
118
+      extern Trinamic_TMC2130 stepperY;
119
+    #endif
107 120
     #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN)
108 121
     #define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE)
109 122
     #define Y_ENABLE_READ READ(Y_ENABLE_PIN)
@@ -132,6 +145,9 @@
132 145
     #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE)
133 146
     #define Z_ENABLE_READ stepperZ.isEnabled()
134 147
   #else
148
+    #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(Z_IS_TMC2130)
149
+      extern Trinamic_TMC2130 stepperZ;
150
+    #endif
135 151
     #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN)
136 152
     #define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE)
137 153
     #define Z_ENABLE_READ READ(Z_ENABLE_PIN)
@@ -161,6 +177,9 @@
161 177
       #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
162 178
       #define X2_ENABLE_READ stepperX2.isEnabled()
163 179
     #else
180
+      #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(X2_IS_TMC2130)
181
+        extern Trinamic_TMC2130 stepperX2;
182
+      #endif
164 183
       #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN)
165 184
       #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE)
166 185
       #define X2_ENABLE_READ READ(X2_ENABLE_PIN)
@@ -191,6 +210,9 @@
191 210
       #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
192 211
       #define Y2_ENABLE_READ stepperY2.isEnabled()
193 212
     #else
213
+      #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(Y2_IS_TMC2130)
214
+        extern Trinamic_TMC2130 stepperY2;
215
+      #endif
194 216
       #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN)
195 217
       #define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE)
196 218
       #define Y2_ENABLE_READ READ(Y2_ENABLE_PIN)
@@ -221,6 +243,9 @@
221 243
       #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
222 244
       #define Z2_ENABLE_READ stepperZ2.isEnabled()
223 245
     #else
246
+      #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(Z2_IS_TMC2130)
247
+        extern Trinamic_TMC2130 stepperZ2;
248
+      #endif
224 249
       #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN)
225 250
       #define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE)
226 251
       #define Z2_ENABLE_READ READ(Z2_ENABLE_PIN)
@@ -250,6 +275,9 @@
250 275
     #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
251 276
     #define E0_ENABLE_READ stepperE0.isEnabled()
252 277
   #else
278
+    #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(E0_IS_TMC2130)
279
+      extern Trinamic_TMC2130 stepperE0;
280
+    #endif
253 281
     #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN)
254 282
     #define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE)
255 283
     #define E0_ENABLE_READ READ(E0_ENABLE_PIN)
@@ -278,6 +306,9 @@
278 306
     #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
279 307
     #define E1_ENABLE_READ stepperE1.isEnabled()
280 308
   #else
309
+    #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(E1_IS_TMC2130)
310
+      extern Trinamic_TMC2130 stepperE1;
311
+    #endif
281 312
     #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN)
282 313
     #define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE)
283 314
     #define E1_ENABLE_READ READ(E1_ENABLE_PIN)
@@ -306,6 +337,9 @@
306 337
     #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
307 338
     #define E2_ENABLE_READ stepperE2.isEnabled()
308 339
   #else
340
+    #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(E2_IS_TMC2130)
341
+      extern Trinamic_TMC2130 stepperE2;
342
+    #endif
309 343
     #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN)
310 344
     #define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE)
311 345
     #define E2_ENABLE_READ READ(E2_ENABLE_PIN)
@@ -334,6 +368,9 @@
334 368
     #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
335 369
     #define E3_ENABLE_READ stepperE3.isEnabled()
336 370
   #else
371
+    #if ENABLED(HAVE_TMC2130DRIVER) && ENABLED(E3_IS_TMC2130)
372
+      extern Trinamic_TMC2130 stepperE3;
373
+    #endif
337 374
     #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN)
338 375
     #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE)
339 376
     #define E3_ENABLE_READ READ(E3_ENABLE_PIN)

Loading…
Cancel
Save