Skip to content

Commit

Permalink
🔧 Merge TMC26X into TMC config
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Nov 27, 2022
1 parent 65b9e3f commit 571b3c9
Show file tree
Hide file tree
Showing 295 changed files with 12,992 additions and 52,520 deletions.
244 changes: 56 additions & 188 deletions config/default/Configuration_adv.h

Large diffs are not rendered by default.

222 changes: 44 additions & 178 deletions config/examples/3DFabXYZ/Migbot/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2684,167 +2684,33 @@
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
#endif

/**
* TMC26X Stepper Driver options
*
* The TMC26XStepper library is required for this stepper driver.
* https://github.com/trinamic/TMC26XStepper
* @section tmc/tmc26x
*/
#if HAS_DRIVER(TMC26X)

#if AXIS_DRIVER_TYPE_X(TMC26X)
#define X_MAX_CURRENT 1000 // (mA)
#define X_SENSE_RESISTOR 91 // (mOhms)
#define X_MICROSTEPS 16 // Number of microsteps
#endif

#if AXIS_DRIVER_TYPE_X2(TMC26X)
#define X2_MAX_CURRENT 1000
#define X2_SENSE_RESISTOR 91
#define X2_MICROSTEPS X_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_Y(TMC26X)
#define Y_MAX_CURRENT 1000
#define Y_SENSE_RESISTOR 91
#define Y_MICROSTEPS 16
#endif

#if AXIS_DRIVER_TYPE_Y2(TMC26X)
#define Y2_MAX_CURRENT 1000
#define Y2_SENSE_RESISTOR 91
#define Y2_MICROSTEPS Y_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_Z(TMC26X)
#define Z_MAX_CURRENT 1000
#define Z_SENSE_RESISTOR 91
#define Z_MICROSTEPS 16
#endif

#if AXIS_DRIVER_TYPE_Z2(TMC26X)
#define Z2_MAX_CURRENT 1000
#define Z2_SENSE_RESISTOR 91
#define Z2_MICROSTEPS Z_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_Z3(TMC26X)
#define Z3_MAX_CURRENT 1000
#define Z3_SENSE_RESISTOR 91
#define Z3_MICROSTEPS Z_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_Z4(TMC26X)
#define Z4_MAX_CURRENT 1000
#define Z4_SENSE_RESISTOR 91
#define Z4_MICROSTEPS Z_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_I(TMC26X)
#define I_MAX_CURRENT 1000
#define I_SENSE_RESISTOR 91
#define I_MICROSTEPS 16
#endif

#if AXIS_DRIVER_TYPE_J(TMC26X)
#define J_MAX_CURRENT 1000
#define J_SENSE_RESISTOR 91
#define J_MICROSTEPS 16
#endif

#if AXIS_DRIVER_TYPE_K(TMC26X)
#define K_MAX_CURRENT 1000
#define K_SENSE_RESISTOR 91
#define K_MICROSTEPS 16
#endif

#if AXIS_DRIVER_TYPE_U(TMC26X)
#define U_MAX_CURRENT 1000
#define U_SENSE_RESISTOR 91
#define U_MICROSTEPS 16
#endif

#if AXIS_DRIVER_TYPE_V(TMC26X)
#define V_MAX_CURRENT 1000
#define V_SENSE_RESISTOR 91
#define V_MICROSTEPS 16
#endif

#if AXIS_DRIVER_TYPE_W(TMC26X)
#define W_MAX_CURRENT 1000
#define W_SENSE_RESISTOR 91
#define W_MICROSTEPS 16
#endif

#if AXIS_DRIVER_TYPE_E0(TMC26X)
#define E0_MAX_CURRENT 1000
#define E0_SENSE_RESISTOR 91
#define E0_MICROSTEPS 16
#endif

#if AXIS_DRIVER_TYPE_E1(TMC26X)
#define E1_MAX_CURRENT 1000
#define E1_SENSE_RESISTOR 91
#define E1_MICROSTEPS E0_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_E2(TMC26X)
#define E2_MAX_CURRENT 1000
#define E2_SENSE_RESISTOR 91
#define E2_MICROSTEPS E0_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_E3(TMC26X)
#define E3_MAX_CURRENT 1000
#define E3_SENSE_RESISTOR 91
#define E3_MICROSTEPS E0_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_E4(TMC26X)
#define E4_MAX_CURRENT 1000
#define E4_SENSE_RESISTOR 91
#define E4_MICROSTEPS E0_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_E5(TMC26X)
#define E5_MAX_CURRENT 1000
#define E5_SENSE_RESISTOR 91
#define E5_MICROSTEPS E0_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_E6(TMC26X)
#define E6_MAX_CURRENT 1000
#define E6_SENSE_RESISTOR 91
#define E6_MICROSTEPS E0_MICROSTEPS
#endif

#if AXIS_DRIVER_TYPE_E7(TMC26X)
#define E7_MAX_CURRENT 1000
#define E7_SENSE_RESISTOR 91
#define E7_MICROSTEPS E0_MICROSTEPS
#endif

#endif // TMC26X
// @section tmc_smart

/**
* To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 stepper drivers in SPI mode
* connect your SPI pins to the hardware SPI interface on your board and define
* the required CS pins in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3
* pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
* You may also use software SPI if you wish to use general purpose IO pins.
* Trinamic Smart Drivers
*
* To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 stepper drivers in SPI mode:
* - Connect your SPI pins to the Hardware SPI interface on the board.
* Some boards have simple jumper connections! See your board's documentation.
* - Define the required Stepper CS pins in your `pins_MYBOARD.h` file.
* (See the RAMPS pins, for example.)
* - You can also use Software SPI with GPIO pins instead of Hardware SPI.
*
* To use TMC220x stepper drivers with Serial UART:
* - Connect PDN_UART to the #_SERIAL_TX_PIN through a 1K resistor.
* For reading capabilities also connect PDN_UART to #_SERIAL_RX_PIN with no resistor.
* Some boards have simple jumper connections! See your board's documentation.
* - These drivers can also be used with Hardware Serial.
*
* The TMC26XStepper library is required for TMC26X stepper drivers.
* https://github.com/MarlinFirmware/TMC26XStepper
*
* To use TMC2208 stepper UART-configurable stepper drivers connect #_SERIAL_TX_PIN
* to the driver side PDN_UART pin with a 1K resistor.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without
* a resistor.
* The drivers can also be used with hardware serial.
* The TMCStepper library is required for other TMC stepper drivers.
* https://github.com/teemuatlut/TMCStepper
*
* TMCStepper library is required to use TMC stepper drivers.
* https://github.com/teemuatlut/TMCStepper
* @section tmc/config
*/
#if HAS_TRINAMIC_CONFIG
#if HAS_TRINAMIC_CONFIG || HAS_TMC26X

#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current

Expand All @@ -2854,17 +2720,17 @@
*/
#define INTERPOLATE true

#if AXIS_IS_TMC(X)
#if AXIS_IS_TMC_CONFIG(X)
#define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
#define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing
#define X_MICROSTEPS 16 // 0..256
#define X_RSENSE 0.11
#define X_RSENSE 0.11 // Multiplied x1000 for TMC26X
#define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ...
//#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis
//#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis
#endif

#if AXIS_IS_TMC(X2)
#if AXIS_IS_TMC_CONFIG(X2)
#define X2_CURRENT 800
#define X2_CURRENT_HOME X2_CURRENT
#define X2_MICROSTEPS X_MICROSTEPS
Expand All @@ -2874,7 +2740,7 @@
//#define X2_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(Y)
#if AXIS_IS_TMC_CONFIG(Y)
#define Y_CURRENT 800
#define Y_CURRENT_HOME Y_CURRENT
#define Y_MICROSTEPS 16
Expand All @@ -2884,7 +2750,7 @@
//#define Y_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(Y2)
#if AXIS_IS_TMC_CONFIG(Y2)
#define Y2_CURRENT 800
#define Y2_CURRENT_HOME Y2_CURRENT
#define Y2_MICROSTEPS Y_MICROSTEPS
Expand All @@ -2894,7 +2760,7 @@
//#define Y2_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(Z)
#if AXIS_IS_TMC_CONFIG(Z)
#define Z_CURRENT 800
#define Z_CURRENT_HOME Z_CURRENT
#define Z_MICROSTEPS 16
Expand All @@ -2904,7 +2770,7 @@
//#define Z_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(Z2)
#if AXIS_IS_TMC_CONFIG(Z2)
#define Z2_CURRENT 800
#define Z2_CURRENT_HOME Z2_CURRENT
#define Z2_MICROSTEPS Z_MICROSTEPS
Expand All @@ -2914,7 +2780,7 @@
//#define Z2_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(Z3)
#if AXIS_IS_TMC_CONFIG(Z3)
#define Z3_CURRENT 800
#define Z3_CURRENT_HOME Z3_CURRENT
#define Z3_MICROSTEPS Z_MICROSTEPS
Expand All @@ -2924,7 +2790,7 @@
//#define Z3_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(Z4)
#if AXIS_IS_TMC_CONFIG(Z4)
#define Z4_CURRENT 800
#define Z4_CURRENT_HOME Z4_CURRENT
#define Z4_MICROSTEPS Z_MICROSTEPS
Expand All @@ -2934,7 +2800,7 @@
//#define Z4_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(I)
#if AXIS_IS_TMC_CONFIG(I)
#define I_CURRENT 800
#define I_CURRENT_HOME I_CURRENT
#define I_MICROSTEPS 16
Expand All @@ -2944,7 +2810,7 @@
//#define I_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(J)
#if AXIS_IS_TMC_CONFIG(J)
#define J_CURRENT 800
#define J_CURRENT_HOME J_CURRENT
#define J_MICROSTEPS 16
Expand All @@ -2954,7 +2820,7 @@
//#define J_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(K)
#if AXIS_IS_TMC_CONFIG(K)
#define K_CURRENT 800
#define K_CURRENT_HOME K_CURRENT
#define K_MICROSTEPS 16
Expand All @@ -2964,7 +2830,7 @@
//#define K_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(U)
#if AXIS_IS_TMC_CONFIG(U)
#define U_CURRENT 800
#define U_CURRENT_HOME U_CURRENT
#define U_MICROSTEPS 8
Expand All @@ -2974,7 +2840,7 @@
//#define U_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(V)
#if AXIS_IS_TMC_CONFIG(V)
#define V_CURRENT 800
#define V_CURRENT_HOME V_CURRENT
#define V_MICROSTEPS 8
Expand All @@ -2984,7 +2850,7 @@
//#define V_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(W)
#if AXIS_IS_TMC_CONFIG(W)
#define W_CURRENT 800
#define W_CURRENT_HOME W_CURRENT
#define W_MICROSTEPS 8
Expand All @@ -2994,7 +2860,7 @@
//#define W_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(E0)
#if AXIS_IS_TMC_CONFIG(E0)
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
#define E0_RSENSE 0.11
Expand All @@ -3003,7 +2869,7 @@
//#define E0_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(E1)
#if AXIS_IS_TMC_CONFIG(E1)
#define E1_CURRENT 800
#define E1_MICROSTEPS E0_MICROSTEPS
#define E1_RSENSE 0.11
Expand All @@ -3012,7 +2878,7 @@
//#define E1_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(E2)
#if AXIS_IS_TMC_CONFIG(E2)
#define E2_CURRENT 800
#define E2_MICROSTEPS E0_MICROSTEPS
#define E2_RSENSE 0.11
Expand All @@ -3021,7 +2887,7 @@
//#define E2_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(E3)
#if AXIS_IS_TMC_CONFIG(E3)
#define E3_CURRENT 800
#define E3_MICROSTEPS E0_MICROSTEPS
#define E3_RSENSE 0.11
Expand All @@ -3030,7 +2896,7 @@
//#define E3_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(E4)
#if AXIS_IS_TMC_CONFIG(E4)
#define E4_CURRENT 800
#define E4_MICROSTEPS E0_MICROSTEPS
#define E4_RSENSE 0.11
Expand All @@ -3039,7 +2905,7 @@
//#define E4_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(E5)
#if AXIS_IS_TMC_CONFIG(E5)
#define E5_CURRENT 800
#define E5_MICROSTEPS E0_MICROSTEPS
#define E5_RSENSE 0.11
Expand All @@ -3048,7 +2914,7 @@
//#define E5_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(E6)
#if AXIS_IS_TMC_CONFIG(E6)
#define E6_CURRENT 800
#define E6_MICROSTEPS E0_MICROSTEPS
#define E6_RSENSE 0.11
Expand All @@ -3057,7 +2923,7 @@
//#define E6_HOLD_MULTIPLIER 0.5
#endif

#if AXIS_IS_TMC(E7)
#if AXIS_IS_TMC_CONFIG(E7)
#define E7_CURRENT 800
#define E7_MICROSTEPS E0_MICROSTEPS
#define E7_RSENSE 0.11
Expand Down
Loading

0 comments on commit 571b3c9

Please sign in to comment.