Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,27 @@
#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.

/**
* Stepper Drivers for all axes
*
* Options: A4988, DRV8825, LV8729, TB6560, TB6600, TMC2100, TMC2130, TMC2208, TMC26X, TMC2660, TMC5130
* Append |SPI_STEPPER for drivers with SPI (e.g., TMC2130|SPI_STEPPER)
* For unspecified drivers, DRV8825 is assumed.
*
* :['A4988', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130|SPI_STEPPER', 'TMC2208', 'TMC2208|SPI_STEPPER', 'TMC26X', 'TMC26X|SPI_STEPPER', 'TMC2660', 'TMC2660|SPI_STEPPER', 'TMC5130', 'TMC5130|SPI_STEPPER']
*/
//#define X_DRIVER_TYPE DRV8825
//#define X2_DRIVER_TYPE DRV8825
//#define Y_DRIVER_TYPE DRV8825
//#define Y2_DRIVER_TYPE DRV8825
//#define Z_DRIVER_TYPE DRV8825
//#define Z2_DRIVER_TYPE DRV8825
//#define E0_DRIVER_TYPE DRV8825
//#define E1_DRIVER_TYPE DRV8825
//#define E2_DRIVER_TYPE DRV8825
//#define E3_DRIVER_TYPE DRV8825
//#define E4_DRIVER_TYPE DRV8825

// Enable this feature if all enabled endstop pins are interrupt-capable.
// This will remove the need to poll the interrupt pins, saving many CPU cycles.
//#define ENDSTOP_INTERRUPTS_FEATURE
Expand Down
88 changes: 16 additions & 72 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@
* 1500 : Minimum for TB6600 drivers (guess, no info in datasheet)
*15000 : Minimum for TB6560 drivers (guess, no info in datasheet)
*/
#define MINIMUM_STEPPER_DIR_DELAY 0
//#define MINIMUM_STEPPER_DIR_DELAY 650

/**
* Minimum stepper driver pulse width (in µs)
Expand All @@ -852,7 +852,7 @@
* 3 : Minimum for TB6600 stepper drivers
* 30 : Minimum for TB6560 stepper drivers
*/
#define MINIMUM_STEPPER_PULSE 2
//#define MINIMUM_STEPPER_PULSE 2

/**
* Maximum stepping rate (in Hz) the stepper driver allows
Expand All @@ -864,7 +864,7 @@
* 130000 : Maximum for LV8729 stepper driver
* 15000 : Maximum for TB6560 stepper driver
*/
#define MAXIMUM_STEPPER_RATE 250000
//#define MAXIMUM_STEPPER_RATE 250000

// @section temperature

Expand Down Expand Up @@ -1036,19 +1036,8 @@
* You will need to import the TMC26XStepper library into the Arduino IDE for this
* (https://github.com/trinamic/TMC26XStepper.git)
*/
//#define HAVE_TMC26X
#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory!
//#define X_IS_TMC26X
//#define X2_IS_TMC26X
//#define Y_IS_TMC26X
//#define Y2_IS_TMC26X
//#define Z_IS_TMC26X
//#define Z2_IS_TMC26X
//#define E0_IS_TMC26X
//#define E1_IS_TMC26X
//#define E2_IS_TMC26X
//#define E3_IS_TMC26X
//#define E4_IS_TMC26X

#if HAVE_SPIDRIVER(TMC26X)

#define X_MAX_CURRENT 1000 // in mA
#define X_SENSE_RESISTOR 91 // in mOhms
Expand Down Expand Up @@ -1094,62 +1083,30 @@
#define E4_SENSE_RESISTOR 91
#define E4_MICROSTEPS 16

#endif
#endif // TMC26X

// @section tmc_smart

/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
*
* You'll also need the TMC2130Stepper Arduino library
* (https://github.com/teemuatlut/TMC2130Stepper).
*
/*
* To use TMC2130 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.
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory!
//#define X_IS_TMC2130
//#define X2_IS_TMC2130
//#define Y_IS_TMC2130
//#define Y2_IS_TMC2130
//#define Z_IS_TMC2130
//#define Z2_IS_TMC2130
//#define E0_IS_TMC2130
//#define E1_IS_TMC2130
//#define E2_IS_TMC2130
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
#endif

/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor.
*
* You'll also need the TMC2130Stepper Arduino library
* (https://github.com/teemuatlut/TMC2130Stepper).
*
* 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.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory!
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
#endif

#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
#if HAVE_SPIDRIVER(TMC2130) || HAVE_SPIDRIVER(TMC2208)

#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
Expand Down Expand Up @@ -1309,20 +1266,7 @@
* (https://github.com/ameyer/Arduino-L6470)
*/

//#define HAVE_L6470DRIVER
#if ENABLED(HAVE_L6470DRIVER)

//#define X_IS_L6470
//#define X2_IS_L6470
//#define Y_IS_L6470
//#define Y2_IS_L6470
//#define Z_IS_L6470
//#define Z2_IS_L6470
//#define E0_IS_L6470
//#define E1_IS_L6470
//#define E2_IS_L6470
//#define E3_IS_L6470
//#define E4_IS_L6470
#if HAVE_SPIDRIVER(L6470)

#define X_MICROSTEPS 16 // number of microsteps
#define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off
Expand Down Expand Up @@ -1368,7 +1312,7 @@
#define E4_OVERCURRENT 2000
#define E4_STALLCURRENT 1500

#endif
#endif // L6470

/**
* TWI/I2C BUS
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_AVR/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
/**
* TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
*/
#if ENABLED(HAVE_TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
#if HAVE_SPIDRIVER(TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
defined(X_HARDWARE_SERIAL ) \
|| defined(X2_HARDWARE_SERIAL) \
|| defined(Y_HARDWARE_SERIAL ) \
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_DUE/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
#define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == MOSI_PIN || TMC_SW_##P == MISO_PIN || TMC_SW_##P == SCK_PIN))

#if ENABLED(SDSUPPORT) && ENABLED(HAVE_TMC2130)
#if ENABLED(SDSUPPORT) && HAVE_SPIDRIVER(TMC2130)
#if ENABLED(TMC_USE_SW_SPI)
#if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
#error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_LPC1768/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#endif
#endif // SPINDLE_LASER_ENABLE

#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && ENABLED(HAVE_TMC2130) && DISABLED(TMC_USE_SW_SPI) \
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAVE_SPIDRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) \
&& (MB(RAMPS_14_RE_ARM_EFB) \
|| MB(RAMPS_14_RE_ARM_EEB) \
|| MB(RAMPS_14_RE_ARM_EFF) \
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/Marlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,10 @@ void setup() {
SERIAL_PROTOCOLLNPGM("start");
SERIAL_ECHO_START();

#if ENABLED(HAVE_TMC2130)
#if HAVE_SPIDRIVER(TMC2130)
tmc_init_cs_pins();
#endif
#if ENABLED(HAVE_TMC2208)
#if HAVE_SPIDRIVER(TMC2208)
tmc2208_serial_begin();
#endif

Expand Down
21 changes: 21 additions & 0 deletions Marlin/src/config/default/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,27 @@
#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.

/**
* Stepper Drivers for all axes
*
* Options: A4988, DRV8825, LV8729, TB6560, TB6600, TMC2100, TMC2130, TMC2208, TMC26X, TMC2660, TMC5130
* Append |SPI_STEPPER for drivers with SPI (e.g., TMC2130|SPI_STEPPER)
* For unspecified drivers, DRV8825 is assumed.
*
* :['A4988', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130|SPI_STEPPER', 'TMC2208', 'TMC2208|SPI_STEPPER', 'TMC26X', 'TMC26X|SPI_STEPPER', 'TMC2660', 'TMC2660|SPI_STEPPER', 'TMC5130', 'TMC5130|SPI_STEPPER']
*/
//#define X_DRIVER_TYPE DRV8825
//#define X2_DRIVER_TYPE DRV8825
//#define Y_DRIVER_TYPE DRV8825
//#define Y2_DRIVER_TYPE DRV8825
//#define Z_DRIVER_TYPE DRV8825
//#define Z2_DRIVER_TYPE DRV8825
//#define E0_DRIVER_TYPE DRV8825
//#define E1_DRIVER_TYPE DRV8825
//#define E2_DRIVER_TYPE DRV8825
//#define E3_DRIVER_TYPE DRV8825
//#define E4_DRIVER_TYPE DRV8825

// Enable this feature if all enabled endstop pins are interrupt-capable.
// This will remove the need to poll the interrupt pins, saving many CPU cycles.
//#define ENDSTOP_INTERRUPTS_FEATURE
Expand Down
88 changes: 16 additions & 72 deletions Marlin/src/config/default/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@
* 1500 : Minimum for TB6600 drivers (guess, no info in datasheet)
*15000 : Minimum for TB6560 drivers (guess, no info in datasheet)
*/
#define MINIMUM_STEPPER_DIR_DELAY 0
//#define MINIMUM_STEPPER_DIR_DELAY 650

/**
* Minimum stepper driver pulse width (in µs)
Expand All @@ -852,7 +852,7 @@
* 3 : Minimum for TB6600 stepper drivers
* 30 : Minimum for TB6560 stepper drivers
*/
#define MINIMUM_STEPPER_PULSE 2
//#define MINIMUM_STEPPER_PULSE 2

/**
* Maximum stepping rate (in Hz) the stepper driver allows
Expand All @@ -864,7 +864,7 @@
* 130000 : Maximum for LV8729 stepper driver
* 15000 : Maximum for TB6560 stepper driver
*/
#define MAXIMUM_STEPPER_RATE 250000
//#define MAXIMUM_STEPPER_RATE 250000

// @section temperature

Expand Down Expand Up @@ -1036,19 +1036,8 @@
* You will need to import the TMC26XStepper library into the Arduino IDE for this
* (https://github.com/trinamic/TMC26XStepper.git)
*/
//#define HAVE_TMC26X
#if ENABLED(HAVE_TMC26X) // Choose your axes here. This is mandatory!
//#define X_IS_TMC26X
//#define X2_IS_TMC26X
//#define Y_IS_TMC26X
//#define Y2_IS_TMC26X
//#define Z_IS_TMC26X
//#define Z2_IS_TMC26X
//#define E0_IS_TMC26X
//#define E1_IS_TMC26X
//#define E2_IS_TMC26X
//#define E3_IS_TMC26X
//#define E4_IS_TMC26X

#if HAVE_SPIDRIVER(TMC26X)

#define X_MAX_CURRENT 1000 // in mA
#define X_SENSE_RESISTOR 91 // in mOhms
Expand Down Expand Up @@ -1094,62 +1083,30 @@
#define E4_SENSE_RESISTOR 91
#define E4_MICROSTEPS 16

#endif
#endif // TMC26X

// @section tmc_smart

/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
*
* You'll also need the TMC2130Stepper Arduino library
* (https://github.com/teemuatlut/TMC2130Stepper).
*
/*
* To use TMC2130 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.
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130) // Choose your axes here. This is mandatory!
//#define X_IS_TMC2130
//#define X2_IS_TMC2130
//#define Y_IS_TMC2130
//#define Y2_IS_TMC2130
//#define Z_IS_TMC2130
//#define Z2_IS_TMC2130
//#define E0_IS_TMC2130
//#define E1_IS_TMC2130
//#define E2_IS_TMC2130
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
#endif

/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor.
*
* You'll also need the TMC2130Stepper Arduino library
* (https://github.com/teemuatlut/TMC2130Stepper).
*
* 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.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2208) // Choose your axes here. This is mandatory!
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
#endif

#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
#if HAVE_SPIDRIVER(TMC2130) || HAVE_SPIDRIVER(TMC2208)

#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
Expand Down Expand Up @@ -1309,20 +1266,7 @@
* (https://github.com/ameyer/Arduino-L6470)
*/

//#define HAVE_L6470DRIVER
#if ENABLED(HAVE_L6470DRIVER)

//#define X_IS_L6470
//#define X2_IS_L6470
//#define Y_IS_L6470
//#define Y2_IS_L6470
//#define Z_IS_L6470
//#define Z2_IS_L6470
//#define E0_IS_L6470
//#define E1_IS_L6470
//#define E2_IS_L6470
//#define E3_IS_L6470
//#define E4_IS_L6470
#if HAVE_SPIDRIVER(L6470)

#define X_MICROSTEPS 16 // number of microsteps
#define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off
Expand Down Expand Up @@ -1368,7 +1312,7 @@
#define E4_OVERCURRENT 2000
#define E4_STALLCURRENT 1500

#endif
#endif // L6470

/**
* TWI/I2C BUS
Expand Down
Loading