Add TMC2209 support (#14249)

This commit is contained in:
Scott Lahteine
2019-06-20 15:47:50 -05:00
committed by GitHub
parent ed0c70f0a0
commit 4df4c47994
208 changed files with 2732 additions and 644 deletions

View File

@ -1716,7 +1716,6 @@
//#define E5_CS_PIN -1
/**
* Use software SPI for TMC2130.
* Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160).
* The default SW SPI pins are defined the respective pins files,
* but you can override or define them here.
@ -1726,6 +1725,29 @@
//#define TMC_SW_MISO -1
//#define TMC_SW_SCK -1
/**
* Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses.
* Set the address using jumpers on pins MS1 and MS2.
* Address | MS1 | MS2
* 0 | LOW | LOW
* 1 | HIGH | LOW
* 2 | LOW | HIGH
* 3 | HIGH | HIGH
*/
#define X_SLAVE_ADDRESS 0
#define Y_SLAVE_ADDRESS 0
#define Z_SLAVE_ADDRESS 0
#define X2_SLAVE_ADDRESS 0
#define Y2_SLAVE_ADDRESS 0
#define Z2_SLAVE_ADDRESS 0
#define Z3_SLAVE_ADDRESS 0
#define E0_SLAVE_ADDRESS 0
#define E1_SLAVE_ADDRESS 0
#define E2_SLAVE_ADDRESS 0
#define E3_SLAVE_ADDRESS 0
#define E4_SLAVE_ADDRESS 0
#define E5_SLAVE_ADDRESS 0
/**
* Software enable
*
@ -1735,7 +1757,7 @@
//#define SOFTWARE_DRIVER_ENABLE
/**
* TMC2130, TMC2160, TMC2208, TMC5130 and TMC5160 only
* TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only
* Use Trinamic's ultra quiet stepping mode.
* When disabled, Marlin will use spreadCycle stepping mode.
*/
@ -1761,7 +1783,7 @@
/**
* Monitor Trinamic drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* like overtemperature and short to ground.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
@ -1779,7 +1801,7 @@
#endif
/**
* TMC2130, TMC2160, TMC2208, TMC5130 and TMC5160 only
* TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only
* The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD.
* This mode allows for faster movements at the expense of higher noise levels.
* STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD.
@ -1802,7 +1824,7 @@
#define E5_HYBRID_THRESHOLD 30
/**
* TMC2130, TMC2160, TMC2660, TMC5130, and TMC5160 only
* TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only
* Use StallGuard2 to sense an obstacle and trigger an endstop.
* Connect the stepper driver's DIAG1 pin to the X/Y endstop pin.
* X, Y, and Z homing will always be done in spreadCycle mode.
@ -1814,7 +1836,7 @@
* It is advised to set X/Y/Z_HOME_BUMP_MM to 0.
* M914 X/Y/Z to live tune the setting
*/
//#define SENSORLESS_HOMING // TMC2130 only
//#define SENSORLESS_HOMING // StallGuard capable drivers only
/**
* Use StallGuard2 to probe the bed with the nozzle.
@ -1822,9 +1844,10 @@
* CAUTION: This could cause damage to machines that use a lead screw or threaded rod
* to move the Z axis. Take extreme care when attempting to enable this feature.
*/
//#define SENSORLESS_PROBING // TMC2130 only
//#define SENSORLESS_PROBING // StallGuard capable drivers only
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
// TMC2209: 0...255. TMC2130: -64...63
#define X_STALL_SENSITIVITY 8
#define Y_STALL_SENSITIVITY 8
//#define Z_STALL_SENSITIVITY 8