diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 690a64e590f0..81b31d199796 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 497f283fdad0..a6d8dc217d29 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1682,12 +1682,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1697,112 +1697,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1828,7 +1841,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/Marlin/src/HAL/HAL_LINUX/include/serial.h b/Marlin/src/HAL/HAL_LINUX/include/serial.h index 9b439de98589..334d5816a378 100644 --- a/Marlin/src/HAL/HAL_LINUX/include/serial.h +++ b/Marlin/src/HAL/HAL_LINUX/include/serial.h @@ -138,6 +138,8 @@ class HalSerial { #define OCT 8 #define BIN 2 + void print_bin(const uint16_t val); + void print_bin(uint32_t value, uint8_t num_digits) { uint32_t mask = 1 << (num_digits -1); for (uint8_t i = 0; i < num_digits; i++) { diff --git a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp index ecd808fe46ee..3e15f0c1b834 100644 --- a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp +++ b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp @@ -27,7 +27,7 @@ #include "../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "Delay.h" @@ -40,7 +40,7 @@ #pragma GCC optimize (3) // run at ~4Mhz -uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0 +inline uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0 for (uint8_t bits = 8; bits--;) { WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80); b <<= 1; // little setup time @@ -56,7 +56,7 @@ uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0 return b; } -uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3 +inline uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3 for (uint8_t bits = 8; bits--;) { WRITE(L6470_CHAIN_SCK_PIN, LOW); WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80); @@ -74,55 +74,67 @@ uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3 } /** - * The following are weak-linked and defined as do-nothing - * functions by the L6470-Arduino library. They must be - * defined by the client (Marlin) to provide an SPI interface. + * L64XX methods for SPI init and transfer */ +void L64XX_Marlin::spi_init() { + OUT_WRITE(L6470_CHAIN_SS_PIN, HIGH); + OUT_WRITE(L6470_CHAIN_SCK_PIN, HIGH); + OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); + SET_INPUT(L6470_CHAIN_MISO_PIN); -uint8_t L6470_transfer(uint8_t data, int16_t ss_pin, const uint8_t chain_position) { - uint8_t data_out = 0; + #if PIN_EXISTS(L6470_BUSY) + SET_INPUT(L6470_BUSY_PIN); + #endif + OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); +} + +uint8_t L64XX_Marlin::transfer_single(uint8_t data, int16_t ss_pin) { // first device in chain has data sent last - extDigitalWrite(ss_pin, LOW); + digitalWrite(ss_pin, LOW); - for (uint8_t i = L6470::chain[0]; (i >= 1) && !spi_abort; i--) { // stop sending data if spi_abort is active - DISABLE_ISRS(); // disable interrupts during SPI transfer (can't allow partial command to chips) - uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP)); - ENABLE_ISRS(); // enable interrupts - if (i == chain_position) data_out = temp; - } + DISABLE_ISRS(); // disable interrupts during SPI transfer (can't allow partial command to chips) + const uint8_t data_out = L6470_SpiTransfer_Mode_3(data); + ENABLE_ISRS(); // enable interrupts - extDigitalWrite(ss_pin, HIGH); + digitalWrite(ss_pin, HIGH); return data_out; } -void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) { +uint8_t L64XX_Marlin::transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain_position) { + uint8_t data_out = 0; + // first device in chain has data sent last + digitalWrite(ss_pin, LOW); - if (spi_active) { // interrupted SPI transfer so need to - WRITE(L6470_CHAIN_SS_PIN, HIGH); // guarantee min high of 650nS - DELAY_US(1); + for (uint8_t i = L64XX::chain[0]; (i >= 1) && !L64xx_MARLIN.spi_abort; i--) { // stop sending data if spi_abort is active + DISABLE_ISRS(); // disable interrupts during SPI transfer (can't allow partial command to chips) + const uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP)); + ENABLE_ISRS(); // enable interrupts + if (i == chain_position) data_out = temp; } - WRITE(L6470_CHAIN_SS_PIN, LOW); - for (uint8_t i = length; i >= 1; i--) - L6470_SpiTransfer_Mode_3(uint8_t(L6470_buf[i])); - WRITE(L6470_CHAIN_SS_PIN, HIGH); + digitalWrite(ss_pin, HIGH); + return data_out; } -void L6470_spi_init() { - OUT_WRITE(L6470_CHAIN_SS_PIN, HIGH); - OUT_WRITE(L6470_CHAIN_SCK_PIN, HIGH); - OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); - SET_INPUT(L6470_CHAIN_MISO_PIN); - - #if PIN_EXISTS(L6470_BUSY) - SET_INPUT(L6470_BUSY_PIN); - #endif - - OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); +/** + * Platform-supplied L6470 buffer transfer method + */ +void L64XX_Marlin::transfer(uint8_t L6470_buf[], const uint8_t length) { + // First device in chain has its data sent last + + if (spi_active) { // interrupted SPI transfer so need to + WRITE(L6470_CHAIN_SS_PIN, HIGH); // guarantee min high of 650nS + DELAY_US(1); + } + + WRITE(L6470_CHAIN_SS_PIN, LOW); + for (uint8_t i = length; i >= 1; i--) + L6470_SpiTransfer_Mode_3(uint8_t(L6470_buf[i])); + WRITE(L6470_CHAIN_SS_PIN, HIGH); } #pragma GCC reset_options -#endif // HAS_DRIVER(L6470) +#endif // HAS_L64XX diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 6a55b399c1e9..623986ef09f8 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -172,7 +172,7 @@ #include "lcd/extensible_ui/ui_api.h" #endif -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "libs/L6470/L6470_Marlin.h" #endif @@ -639,7 +639,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - L6470.monitor_driver(); + L64xx_MARLIN.monitor_driver(); #endif // Limit check_axes_activity frequency to 10Hz @@ -843,8 +843,8 @@ void setup() { HAL_init(); #endif - #if HAS_DRIVER(L6470) - L6470.init(); // setup SPI and then init chips + #if HAS_L64XX + L64xx_MARLIN.init(); // setup SPI and init chips #endif #if ENABLED(MAX7219_DEBUG) diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index 1252d7f574ac..d182b97f3986 100644 --- a/Marlin/src/Marlin.h +++ b/Marlin/src/Marlin.h @@ -31,11 +31,6 @@ #include #include -#if HAS_DRIVER(L6470) - #include "libs/L6470/L6470_Marlin.h" - extern uint8_t axis_known_position; -#endif - void stop(); void idle( @@ -49,8 +44,8 @@ void manage_inactivity(const bool ignore_stepper_queue=false); // // X, Y, Z Stepper enable / disable // -#if AXIS_DRIVER_TYPE_X(L6470) - extern L6470 stepperX; + +#if AXIS_IS_L64XX(X) #define X_enable NOOP #define X_disable stepperX.free() #elif HAS_X_ENABLE @@ -61,8 +56,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define X_disable NOOP #endif -#if AXIS_DRIVER_TYPE_X2(L6470) - extern L6470 stepperX2; +#if AXIS_IS_L64XX(X2) #define X2_enable NOOP #define X2_disable stepperX2.free() #elif HAS_X2_ENABLE @@ -76,8 +70,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define enable_X() do{ X_enable; X2_enable; }while(0) #define disable_X() do{ X_disable; X2_disable; CBI(axis_known_position, X_AXIS); }while(0) -#if AXIS_DRIVER_TYPE_Y(L6470) - extern L6470 stepperY; +#if AXIS_IS_L64XX(Y) #define Y_enable NOOP #define Y_disable stepperY.free() #elif HAS_Y_ENABLE @@ -88,8 +81,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define Y_disable NOOP #endif -#if AXIS_DRIVER_TYPE_Y2(L6470) - extern L6470 stepperY2; +#if AXIS_IS_L64XX(Y2) #define Y2_enable NOOP #define Y2_disable stepperY2.free() #elif HAS_Y2_ENABLE @@ -103,8 +95,8 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define enable_Y() do{ Y_enable; Y2_enable; }while(0) #define disable_Y() do{ Y_disable; Y2_disable; CBI(axis_known_position, Y_AXIS); }while(0) -#if AXIS_DRIVER_TYPE_Z(L6470) - extern L6470 stepperZ; + +#if AXIS_IS_L64XX(Z) #define Z_enable NOOP #define Z_disable stepperZ.free() #elif HAS_Z_ENABLE @@ -115,8 +107,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define Z_disable NOOP #endif -#if AXIS_DRIVER_TYPE_Z2(L6470) - extern L6470 stepperZ2; +#if AXIS_IS_L64XX(Z2) #define Z2_enable NOOP #define Z2_disable stepperZ2.free() #elif HAS_Z2_ENABLE @@ -127,8 +118,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define Z2_disable NOOP #endif -#if AXIS_DRIVER_TYPE_Z3(L6470) - extern L6470 stepperZ3; +#if AXIS_IS_L64XX(Z3) #define Z3_enable NOOP #define Z3_disable stepperZ3.free() #elif HAS_Z3_ENABLE @@ -146,9 +136,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); // Extruder Stepper enable / disable // -// define the individual enables/disables -#if AXIS_DRIVER_TYPE_E0(L6470) - extern L6470 stepperE0; +#if AXIS_IS_L64XX(E0) #define E0_enable NOOP #define E0_disable do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif HAS_E0_ENABLE @@ -159,8 +147,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define E0_disable NOOP #endif -#if AXIS_DRIVER_TYPE_E1(L6470) - extern L6470 stepperE1; +#if AXIS_IS_L64XX(E1) #define E1_enable NOOP #define E1_disable do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 1 && HAS_E1_ENABLE @@ -171,8 +158,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define E1_disable NOOP #endif -#if AXIS_DRIVER_TYPE_E2(L6470) - extern L6470 stepperE2; +#if AXIS_IS_L64XX(E2) #define E2_enable NOOP #define E2_disable do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 2 && HAS_E2_ENABLE @@ -183,8 +169,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define E2_disable NOOP #endif -#if AXIS_DRIVER_TYPE_E3(L6470) - extern L6470 stepperE3; +#if AXIS_IS_L64XX(E3) #define E3_enable NOOP #define E3_disable do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 3 && HAS_E3_ENABLE @@ -195,8 +180,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define E3_disable NOOP #endif -#if AXIS_DRIVER_TYPE_E4(L6470) - extern L6470 stepperE4; +#if AXIS_IS_L64XX(E4) #define E4_enable NOOP #define E4_disable do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 4 && HAS_E4_ENABLE @@ -207,8 +191,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define E4_disable NOOP #endif -#if AXIS_DRIVER_TYPE_E5(L6470) - extern L6470 stepperE5; +#if AXIS_IS_L64XX(E5) #define E5_enable NOOP #define E5_disable do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 5 && HAS_E5_ENABLE diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index a405bd3144ad..ffa46c1c1856 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -28,6 +28,8 @@ #define _DRV8825 0x003 #define _LV8729 0x004 #define _L6470 0x105 +#define _L6480 0x106 +#define _powerSTEP01 0x107 #define _TB6560 0x006 #define _TB6600 0x007 #define _TMC2100 0x008 @@ -52,10 +54,10 @@ #define AXIS_DRIVER_TYPE_X(T) _AXIS_DRIVER_TYPE(X,T) #define AXIS_DRIVER_TYPE_Y(T) _AXIS_DRIVER_TYPE(Y,T) #define AXIS_DRIVER_TYPE_Z(T) _AXIS_DRIVER_TYPE(Z,T) -#define AXIS_DRIVER_TYPE_X2(T) (EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) && _AXIS_DRIVER_TYPE(X2,T)) -#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T)) -#define AXIS_DRIVER_TYPE_Z2(T) (Z_MULTI_STEPPER_DRIVERS && _AXIS_DRIVER_TYPE(Z2,T)) -#define AXIS_DRIVER_TYPE_Z3(T) (ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Z3,T)) +#define AXIS_DRIVER_TYPE_X2(T) _AXIS_DRIVER_TYPE(X2,T) +#define AXIS_DRIVER_TYPE_Y2(T) _AXIS_DRIVER_TYPE(Y2,T) +#define AXIS_DRIVER_TYPE_Z2(T) _AXIS_DRIVER_TYPE(Z2,T) +#define AXIS_DRIVER_TYPE_Z3(T) _AXIS_DRIVER_TYPE(Z3,T) #define AXIS_DRIVER_TYPE_E0(T) (E_STEPPERS > 0 && _AXIS_DRIVER_TYPE(E0,T)) #define AXIS_DRIVER_TYPE_E1(T) (E_STEPPERS > 1 && _AXIS_DRIVER_TYPE(E1,T)) #define AXIS_DRIVER_TYPE_E2(T) (E_STEPPERS > 2 && _AXIS_DRIVER_TYPE(E2,T)) @@ -82,3 +84,191 @@ AXIS_DRIVER_TYPE_##A(TMC2660) || \ AXIS_DRIVER_TYPE_##A(TMC5130) || \ AXIS_DRIVER_TYPE_##A(TMC5160)) + +#define HAS_L64XX (HAS_DRIVER(L6470) || HAS_DRIVER(L6480) || HAS_DRIVER(powerSTEP01)) + +#define AXIS_IS_L64XX(A) (AXIS_DRIVER_TYPE_##A(L6470) || AXIS_DRIVER_TYPE_##A(L6480) || AXIS_DRIVER_TYPE_##A(powerSTEP01)) + +#define AXIS_CLASS(A) AXIS_CLASS_##A + +#if AXIS_IS_TMC(X) + #define AXIS_CLASS_X TMC_CLASS(X) +#elif AXIS_DRIVER_TYPE_X(TMC26X) + #define AXIS_CLASS_X TMC26XStepper +#elif AXIS_DRIVER_TYPE_X(L6470) + #define AXIS_CLASS_X L6470 +#elif AXIS_DRIVER_TYPE_X(L6480) + #define AXIS_CLASS_X L6480 +#elif AXIS_DRIVER_TYPE_X(powerSTEP01) + #define AXIS_CLASS_X powerSTEP01 +#else + #define AXIS_CLASS_X no_class +#endif + +#if AXIS_IS_TMC(Y) + #define AXIS_CLASS_Y TMC_CLASS(Y) +#elif AXIS_DRIVER_TYPE_Y(TMC26X) + #define AXIS_CLASS_Y TMC26XStepper +#elif AXIS_DRIVER_TYPE_Y(L6470) + #define AXIS_CLASS_Y L6470 +#elif AXIS_DRIVER_TYPE_Y(L6480) + #define AXIS_CLASS_Y L6480 +#elif AXIS_DRIVER_TYPE_Y(powerSTEP01) + #define AXIS_CLASS_Y powerSTEP01 +#else + #define AXIS_CLASS_Y no_class +#endif + +#if AXIS_IS_TMC(Z) + #define AXIS_CLASS_Z TMC_CLASS(Z) +#elif AXIS_DRIVER_TYPE_Z(TMC26X) + #define AXIS_CLASS_Z TMC26XStepper +#elif AXIS_DRIVER_TYPE_Z(L6470) + #define AXIS_CLASS_Z L6470 +#elif AXIS_DRIVER_TYPE_Z(L6480) + #define AXIS_CLASS_Z L6480 +#elif AXIS_DRIVER_TYPE_Z(powerSTEP01) + #define AXIS_CLASS_Z powerSTEP01 +#else + #define AXIS_CLASS_Z no_class +#endif + +#if AXIS_IS_TMC(X2) + #define AXIS_CLASS_X2 TMC_CLASS(X2) +#elif AXIS_DRIVER_TYPE_X2(TMC26X) + #define AXIS_CLASS_X2 TMC26XStepper +#elif AXIS_DRIVER_TYPE_X2(L6470) + #define AXIS_CLASS_X2 L6470 +#elif AXIS_DRIVER_TYPE_X2(L6480) + #define AXIS_CLASS_X2 L6480 +#elif AXIS_DRIVER_TYPE_X2(powerSTEP01) + #define AXIS_CLASS_X2 powerSTEP01 +#else + #define AXIS_CLASS_X2 no_class +#endif + +#if AXIS_IS_TMC(Y2) + #define AXIS_CLASS_Y2 TMC_CLASS(Y2) +#elif AXIS_DRIVER_TYPE_Y2(TMC26X) + #define AXIS_CLASS_Y2 TMC26XStepper +#elif AXIS_DRIVER_TYPE_Y2(L6470) + #define AXIS_CLASS_Y2 L6470 +#elif AXIS_DRIVER_TYPE_Y2(L6480) + #define AXIS_CLASS_Y2 L6480 +#elif AXIS_DRIVER_TYPE_Y2(powerSTEP01) + #define AXIS_CLASS_Y2 powerSTEP01 +#else + #define AXIS_CLASS_Y2 no_class +#endif + +#if AXIS_IS_TMC(Z2) + #define AXIS_CLASS_Z2 TMC_CLASS(Z2) +#elif AXIS_DRIVER_TYPE_Z2(TMC26X) + #define AXIS_CLASS_Z2 TMC26XStepper +#elif AXIS_DRIVER_TYPE_Z2(L6470) + #define AXIS_CLASS_Z2 L6470 +#elif AXIS_DRIVER_TYPE_Z2(L6480) + #define AXIS_CLASS_Z2 L6480 +#elif AXIS_DRIVER_TYPE_Z2(powerSTEP01) + #define AXIS_CLASS_Z2 powerSTEP01 +#else + #define AXIS_CLASS_Z2 no_class +#endif + +#if AXIS_IS_TMC(Z3) + #define AXIS_CLASS_Z3 TMC_CLASS(Z3) +#elif AXIS_DRIVER_TYPE_Z3(TMC26X) + #define AXIS_CLASS_Z3 TMC26XStepper +#elif AXIS_DRIVER_TYPE_Z3(L6470) + #define AXIS_CLASS_Z3 L6470 +#elif AXIS_DRIVER_TYPE_Z3(L6480) + #define AXIS_CLASS_Z3 L6480 +#elif AXIS_DRIVER_TYPE_Z3(powerSTEP01) + #define AXIS_CLASS_Z3 powerSTEP01 +#else + #define AXIS_CLASS_Z3 no_class +#endif + +#if AXIS_IS_TMC(E0) + #define AXIS_CLASS_E0 TMC_CLASS(E0) +#elif AXIS_DRIVER_TYPE_E0(TMC26X) + #define AXIS_CLASS_E0 TMC26XStepper +#elif AXIS_DRIVER_TYPE_E0(L6470) + #define AXIS_CLASS_E0 L6470 +#elif AXIS_DRIVER_TYPE_E0(L6480) + #define AXIS_CLASS_E0 L6480 +#elif AXIS_DRIVER_TYPE_E0(powerSTEP01) + #define AXIS_CLASS_E0 powerSTEP01 +#else + #define AXIS_CLASS_E0 no_class +#endif + +#if AXIS_IS_TMC(E1) + #define AXIS_CLASS_E1 TMC_CLASS(E1) +#elif AXIS_DRIVER_TYPE_E1(TMC26X) + #define AXIS_CLASS_E1 TMC26XStepper +#elif AXIS_DRIVER_TYPE_E1(L6470) + #define AXIS_CLASS_E1 L6470 +#elif AXIS_DRIVER_TYPE_E1(L6480) + #define AXIS_CLASS_E1 L6480 +#elif AXIS_DRIVER_TYPE_E1(powerSTEP01) + #define AXIS_CLASS_E1 powerSTEP01 +#else + #define AXIS_CLASS_E1 no_class +#endif + +#if AXIS_IS_TMC(E2) + #define AXIS_CLASS_E2 TMC_CLASS(E2) +#elif AXIS_DRIVER_TYPE_E2(TMC26X) + #define AXIS_CLASS_E2 TMC26XStepper +#elif AXIS_DRIVER_TYPE_E2(L6470) + #define AXIS_CLASS_E2 L6470 +#elif AXIS_DRIVER_TYPE_E2(L6480) + #define AXIS_CLASS_E2 L6480 +#elif AXIS_DRIVER_TYPE_E2(powerSTEP01) + #define AXIS_CLASS_E2 powerSTEP01 +#else + #define AXIS_CLASS_E2 no_class +#endif + +#if AXIS_IS_TMC(E3) + #define AXIS_CLASS_E3 TMC_CLASS(E3) +#elif AXIS_DRIVER_TYPE_E3(TMC26X) + #define AXIS_CLASS_E3 TMC26XStepper +#elif AXIS_DRIVER_TYPE_E3(L6470) + #define AXIS_CLASS_E3 L6470 +#elif AXIS_DRIVER_TYPE_E3(L6480) + #define AXIS_CLASS_E3 L6480 +#elif AXIS_DRIVER_TYPE_E3(powerSTEP01) + #define AXIS_CLASS_E3 powerSTEP01 +#else + #define AXIS_CLASS_E3 no_class +#endif + +#if AXIS_IS_TMC(E4) + #define AXIS_CLASS_E4 TMC_CLASS(E4) +#elif AXIS_DRIVER_TYPE_E4(TMC26X) + #define AXIS_CLASS_E4 TMC26XStepper +#elif AXIS_DRIVER_TYPE_E4(L6470) + #define AXIS_CLASS_E4 L6470 +#elif AXIS_DRIVER_TYPE_E4(L6480) + #define AXIS_CLASS_E4 L6480 +#elif AXIS_DRIVER_TYPE_E4(powerSTEP01) + #define AXIS_CLASS_E4 powerSTEP01 +#else + #define AXIS_CLASS_E4 no_class +#endif + +#if AXIS_IS_TMC(E5) + #define AXIS_CLASS_E5 TMC_CLASS(E5) +#elif AXIS_DRIVER_TYPE_E5(TMC26X) + #define AXIS_CLASS_E5 TMC26XStepper +#elif AXIS_DRIVER_TYPE_E5(L6470) + #define AXIS_CLASS_E5 L6470 +#elif AXIS_DRIVER_TYPE_E5(L6480) + #define AXIS_CLASS_E5 L6480 +#elif AXIS_DRIVER_TYPE_E5(powerSTEP01) + #define AXIS_CLASS_E5 powerSTEP01 +#else + #define AXIS_CLASS_E5 no_class +#endif diff --git a/Marlin/src/core/enum.h b/Marlin/src/core/enum.h index d3d7d948da66..acf1713dc30d 100644 --- a/Marlin/src/core/enum.h +++ b/Marlin/src/core/enum.h @@ -43,10 +43,6 @@ enum AxisEnum : unsigned char { NO_AXIS = 0xFF }; -#if HAS_DRIVER(L6470) - enum L6470_driver_enum : unsigned char { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 }; -#endif - #define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=(S); VAR<=(N); VAR++) #define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=(S); VAR<(N); VAR++) #define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 89884f87f172..5665db9a3ce5 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -49,7 +49,7 @@ #include "../../lcd/ultralcd.h" -#if HAS_DRIVER(L6470) // set L6470 absolute position registers to counts +#if HAS_L64XX // set L6470 absolute position registers to counts #include "../../libs/L6470/L6470_Marlin.h" #endif @@ -440,11 +440,18 @@ void GcodeSuite::G28(const bool always_home_all) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G28"); - #if HAS_DRIVER(L6470) + #if HAS_L64XX // Set L6470 absolute position registers to counts - for (uint8_t j = 1; j <= L6470::chain[0]; j++) { - const uint8_t cv = L6470::chain[j]; - L6470.set_param(cv, L6470_ABS_POS, stepper.position((AxisEnum)L6470.axis_xref[cv])); + // constexpr *might* move this to PROGMEM. + // If not, this will need a PROGMEM directive and an accessor. + static constexpr AxisEnum L6470_axis_xref[MAX_L6470] = { + X_AXIS, Y_AXIS, Z_AXIS, + X_AXIS, Y_AXIS, Z_AXIS, Z_AXIS, + E_AXIS, E_AXIS, E_AXIS, E_AXIS, E_AXIS, E_AXIS + }; + for (uint8_t j = 1; j <= L64XX::chain[0]; j++) { + const uint8_t cv = L64XX::chain[j]; + L64xx_MARLIN.set_param((L6470_axis_t)cv, L6470_ABS_POS, stepper.position(L6470_axis_xref[cv])); } #endif } diff --git a/Marlin/src/gcode/feature/L6470/M122.cpp b/Marlin/src/gcode/feature/L6470/M122.cpp index 8f806cbd947b..f5d9d3113d3a 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "../../gcode.h" #include "../../../libs/L6470/L6470_Marlin.h" @@ -30,28 +30,42 @@ inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); } -void L6470_status_decode(const uint16_t status, const uint8_t axis) { - if (L6470.spi_abort) return; // don't do anything if set_directions() has occurred - L6470.say_axis(axis); +inline void L6470_say_status(const L6470_axis_t axis) { + if (L64xx_MARLIN.spi_abort) return; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; + L64xx_MARLIN.get_status(axis); + L64xx_MARLIN.say_axis(axis); #if ENABLED(L6470_CHITCHAT) char temp_buf[20]; - sprintf_P(temp_buf, PSTR(" status: %4x "), status); + sprintf_P(temp_buf, PSTR(" status: %4x "), sh.STATUS_AXIS_RAW); SERIAL_ECHO(temp_buf); - print_bin(status); + print_bin(sh.STATUS_AXIS_RAW); + serialprintPGM(sh.STATUS_AXIS_LAYOUT ? PSTR(" L6470") : PSTR(" L6480/powerSTEP01")); #endif SERIAL_ECHOPGM("\n...OUTPUT: "); - serialprintPGM(status & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); - SERIAL_ECHOPGM(" BUSY: "); echo_yes_no(!(status & STATUS_BUSY)); + serialprintPGM(sh.STATUS_AXIS & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); + SERIAL_ECHOPGM(" BUSY: "); echo_yes_no(!(sh.STATUS_AXIS & STATUS_BUSY)); SERIAL_ECHOPGM(" DIR: "); - serialprintPGM((((status & STATUS_DIR) >> 4) ^ L6470.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); + serialprintPGM((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64xx_MARLIN.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); SERIAL_ECHOPGM(" Last Command: "); - if (status & STATUS_WRONG_CMD) SERIAL_ECHOPGM("IN"); + if (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("IN"); SERIAL_ECHOPGM("VALID "); - serialprintPGM(status & STATUS_NOTPERF_CMD ? PSTR("Not PERFORMED") : PSTR("COMPLETED ")); - SERIAL_ECHOPAIR("\n...THERMAL: ", !(status & STATUS_TH_SD) ? "SHUTDOWN" : !(status & STATUS_TH_WRN) ? "WARNING " : "OK "); - SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no(!(status & STATUS_OCD)); - SERIAL_ECHOPGM(" STALL:"); echo_yes_no(!(status & STATUS_STEP_LOSS_A) || !(status & STATUS_STEP_LOSS_B)); - SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no(status & STATUS_SCK_MOD); + if (sh.STATUS_AXIS_LAYOUT) { + serialprintPGM(sh.STATUS_AXIS & sh.STATUS_AXIS_NOTPERF_CMD ? PSTR("Not PERFORMED") : PSTR("COMPLETED ")); + SERIAL_ECHOPAIR("\n...THERMAL: ", !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK "); + } + else { + SERIAL_ECHOPGM("\n...THERMAL: "); + switch ((sh.STATUS_AXIS & (sh.STATUS_AXIS_TH_SD | sh.STATUS_AXIS_TH_WRN)) >> 11) { + case 0: SERIAL_ECHOPGM("DEVICE SHUTDOWN"); break; + case 1: SERIAL_ECHOPGM("BRIDGE SHUTDOWN"); break; + case 2: SERIAL_ECHOPGM("WARNING "); break; + case 3: SERIAL_ECHOPGM("OK "); break; + } + } + SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no(!(sh.STATUS_AXIS & sh.STATUS_AXIS_OCD)); + SERIAL_ECHOPGM(" STALL:"); echo_yes_no(!(sh.STATUS_AXIS & sh.STATUS_AXIS_STEP_LOSS_A) || !(sh.STATUS_AXIS & sh.STATUS_AXIS_STEP_LOSS_B)); + SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no(sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD); SERIAL_EOL(); } @@ -60,56 +74,54 @@ void L6470_status_decode(const uint16_t status, const uint8_t axis) { */ void GcodeSuite::M122() { - L6470.spi_active = true; // let set_directions() know we're in the middle of a series of SPI transfers - - #define L6470_SAY_STATUS(Q) L6470_status_decode(stepper##Q.getStatus(), Q) + L64xx_MARLIN.spi_active = true; // let set_directions() know we're in the middle of a series of SPI transfers //if (parser.seen('S')) // tmc_set_report_interval(parser.value_bool()); //else - #if AXIS_DRIVER_TYPE_X(L6470) - L6470_SAY_STATUS(X); + #if AXIS_IS_L64XX(X) + L6470_say_status(X); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - L6470_SAY_STATUS(X2); + #if AXIS_IS_L64XX(X2) + L6470_say_status(X2); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - L6470_SAY_STATUS(Y); + #if AXIS_IS_L64XX(Y) + L6470_say_status(Y); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - L6470_SAY_STATUS(Y2); + #if AXIS_IS_L64XX(Y2) + L6470_say_status(Y2); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - L6470_SAY_STATUS(Z); + #if AXIS_IS_L64XX(Z) + L6470_say_status(Z); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - L6470_SAY_STATUS(Z2); + #if AXIS_IS_L64XX(Z2) + L6470_say_status(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - L6470_SAY_STATUS(Z3); + #if AXIS_IS_L64XX(Z3) + L6470_say_status(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - L6470_SAY_STATUS(E0); + #if AXIS_IS_L64XX(E0) + L6470_say_status(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - L6470_SAY_STATUS(E1); + #if AXIS_IS_L64XX(E1) + L6470_say_status(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - L6470_SAY_STATUS(E2); + #if AXIS_IS_L64XX(E2) + L6470_say_status(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - L6470_SAY_STATUS(E3); + #if AXIS_IS_L64XX(E3) + L6470_say_status(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - L6470_SAY_STATUS(E4); + #if AXIS_IS_L64XX(E4) + L6470_say_status(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - L6470_SAY_STATUS(E5); + #if AXIS_IS_L64XX(E5) + L6470_say_status(E5); #endif - L6470.spi_active = false; // done with all SPI transfers - clear handshake flags - L6470.spi_abort = false; + L64xx_MARLIN.spi_active = false; // done with all SPI transfers - clear handshake flags + L64xx_MARLIN.spi_abort = false; } -#endif // HAS_DRIVER(L6470) +#endif // HAS_L64XX diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index 51bcfaee9ef6..6e3d1e09d57f 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "../../gcode.h" #include "../../../libs/L6470/L6470_Marlin.h" @@ -82,42 +82,42 @@ * Vs compensation (if enabled) */ -void L6470_report_current(L6470 &motor, const uint8_t axis) { - if (L6470.spi_abort) return; // don't do anything if set_directions() has occurred - const uint16_t status = motor.getStatus() ; - const uint8_t overcurrent_threshold = (uint8_t)motor.GetParam(L6470_OCD_TH), - stall_threshold = (uint8_t)motor.GetParam(L6470_STALL_TH), - motor_status = (status & (STATUS_MOT_STATUS)) >> 13, - adc_out = motor.GetParam(L6470_ADC_OUT), - adc_out_limited = constrain(adc_out, 8, 24); - const float comp_coef = 1600.0f / adc_out_limited; - const int microsteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); +void L6470_report_current(L64XX &motor, const L6470_axis_t axis) { + if (L64xx_MARLIN.spi_abort) return; // don't do anything if set_directions() has occurred + const uint16_t status = L64xx_MARLIN.get_status(axis); + const uint8_t OverCurrent_Threshold = (uint8_t)motor.GetParam(L6470_OCD_TH), + Stall_Threshold = (uint8_t)motor.GetParam(L6470_STALL_TH), + motor_status = (status & (STATUS_MOT_STATUS)) >> 5, + L6470_ADC_out = motor.GetParam(L6470_ADC_OUT), + L6470_ADC_out_limited = constrain(L6470_ADC_out, 8, 24); + const float comp_coef = 1600.0f / L6470_ADC_out_limited; + const int MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); char temp_buf[80]; - L6470.say_axis(axis); + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; + L64xx_MARLIN.say_axis(axis); #if ENABLED(L6470_CHITCHAT) - sprintf_P(temp_buf, PSTR(" status: %4x "), status); - DEBUG_ECHO(temp_buf); - print_bin(status); + sprintf_P(temp_buf, PSTR(" status: %4x "), sh.STATUS_AXIS_RAW); + SERIAL_ECHO(temp_buf); + print_bin(sh.STATUS_AXIS_RAW); + if (sh.STATUS_AXIS_LAYOUT) SERIAL_ECHOPGM(" L6470"); + else SERIAL_ECHOPGM(" L6480/powerSTEP01"); #endif - sprintf_P(temp_buf, PSTR("\n...OverCurrent Threshold: %2d (%4d mA)"), overcurrent_threshold, (overcurrent_threshold + 1) * 375); + sprintf_P(temp_buf, PSTR("\n...OverCurrent Threshold: %2d (%7.0f mA)"), OverCurrent_Threshold, (OverCurrent_Threshold + 1) * motor.OCD_CURRENT_CONSTANT_INV); SERIAL_ECHO(temp_buf); - sprintf_P(temp_buf, PSTR(" Stall Threshold: %2d (%7.2f mA)"), stall_threshold, (stall_threshold + 1) * 31.25); + sprintf_P(temp_buf, PSTR(" Stall Threshold: %2d (%7.0f mA)"), Stall_Threshold, (Stall_Threshold + 1) * motor.STALL_CURRENT_CONSTANT_INV); SERIAL_ECHO(temp_buf); SERIAL_ECHOPGM(" Motor Status: "); - const char * const stat_str; switch (motor_status) { - default: - case 0: stat_str = PSTR("stopped"); break; - case 1: stat_str = PSTR("accelerating"); break; - case 2: stat_str = PSTR("decelerating"); break; - case 3: stat_str = PSTR("at constant speed"); break; + case 0: SERIAL_ECHOPGM("stopped"); break; + case 1: SERIAL_ECHOPGM("accelerating"); break; + case 2: SERIAL_ECHOPGM("decelerating"); break; + case 3: SERIAL_ECHOPGM("at constant speed"); break; } - serialprintPGM(stat_str); SERIAL_EOL(); - SERIAL_ECHOPAIR("...microsteps: ", microsteps); - SERIAL_ECHOPAIR(" ADC_OUT: ", adc_out); + SERIAL_ECHOPAIR("...MicroSteps: ", MicroSteps); + SERIAL_ECHOPAIR(" ADC_OUT: ", L6470_ADC_out); SERIAL_ECHOPGM(" Vs_compensation: "); - serialprintPGM((motor.GetParam(L6470_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED")); + serialprintPGM((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED")); sprintf_P(temp_buf, PSTR(" Compensation coefficient: ~%4.2f\n"), comp_coef * 0.01f); SERIAL_ECHO(temp_buf); SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD)); @@ -132,6 +132,26 @@ void L6470_report_current(L6470 &motor, const uint8_t axis) { case 3: sprintf_P(temp_buf, PSTR(" %4.1f%% (KVAL_DEC) \n"), float(motor.GetParam(L6470_KVAL_DEC)) * 100 / 256); break; } SERIAL_ECHO(temp_buf); + #if ENABLED(L6470_CHITCHAT) + SERIAL_ECHOPGM("...SLEW RATE: "); + if (sh.STATUS_AXIS_LAYOUT) { + switch ((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT) { + case 0: {SERIAL_ECHOLNPGM("320V/uS") ; break; } + case 1: {SERIAL_ECHOLNPGM("75V/uS") ; break; } + case 2: {SERIAL_ECHOLNPGM("110V/uS") ; break; } + case 3: {SERIAL_ECHOLNPGM("260V/uS") ; break; } + } + } + else { + switch (motor.GetParam(L6470_GATECFG1) & CONFIG1_SR ) { + case CONFIG1_SR_220V_us: {SERIAL_ECHOLNPGM("220V/uS") ; break; } + case CONFIG1_SR_400V_us: {SERIAL_ECHOLNPGM("400V/uS") ; break; } + case CONFIG1_SR_520V_us: {SERIAL_ECHOLNPGM("520V/uS") ; break; } + case CONFIG1_SR_980V_us: {SERIAL_ECHOLNPGM("980V/uS") ; break; } + default: {SERIAL_ECHOLNPGM("unknown") ; break; } + } + } + #endif } void GcodeSuite::M906() { @@ -141,7 +161,7 @@ void GcodeSuite::M906() { bool report_current = true; - #if HAS_DRIVER(L6470) + #if HAS_L64XX const uint8_t index = parser.byteval('I'); #endif @@ -156,29 +176,29 @@ void GcodeSuite::M906() { switch (i) { case X_AXIS: - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) if (index == 0) L6470_SET_KVAL_HOLD(X); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #if AXIS_IS_L64XX(X2) if (index == 1) L6470_SET_KVAL_HOLD(X2); #endif break; case Y_AXIS: - #if AXIS_DRIVER_TYPE_Y(L6470) + #if AXIS_IS_L64XX(Y) if (index == 0) L6470_SET_KVAL_HOLD(Y); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #if AXIS_IS_L64XX(Y2) if (index == 1) L6470_SET_KVAL_HOLD(Y2); #endif break; case Z_AXIS: - #if AXIS_DRIVER_TYPE_Z(L6470) + #if AXIS_IS_L64XX(Z) if (index == 0) L6470_SET_KVAL_HOLD(Z); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #if AXIS_IS_L64XX(Z2) if (index == 1) L6470_SET_KVAL_HOLD(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #if AXIS_IS_L64XX(Z3) if (index == 2) L6470_SET_KVAL_HOLD(Z3); #endif break; @@ -186,22 +206,22 @@ void GcodeSuite::M906() { const int8_t target_extruder = get_target_extruder_from_command(); if (target_extruder < 0) return; switch (target_extruder) { - #if AXIS_DRIVER_TYPE_E0(L6470) + #if AXIS_IS_L64XX(E0) case 0: L6470_SET_KVAL_HOLD(E0); break; #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #if AXIS_IS_L64XX(E1) case 1: L6470_SET_KVAL_HOLD(E1); break; #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #if AXIS_IS_L64XX(E2) case 2: L6470_SET_KVAL_HOLD(E2); break; #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #if AXIS_IS_L64XX(E3) case 3: L6470_SET_KVAL_HOLD(E3); break; #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #if AXIS_IS_L64XX(E4) case 4: L6470_SET_KVAL_HOLD(E4); break; #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #if AXIS_IS_L64XX(E5) case 5: L6470_SET_KVAL_HOLD(E5); break; #endif } @@ -212,51 +232,51 @@ void GcodeSuite::M906() { if (report_current) { #define L6470_REPORT_CURRENT(Q) L6470_report_current(stepper##Q, Q) - L6470.spi_active = true; // let set_directions() know we're in the middle of a series of SPI transfers + L64xx_MARLIN.spi_active = true; // let set_directions() know we're in the middle of a series of SPI transfers - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) L6470_REPORT_CURRENT(X); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #if AXIS_IS_L64XX(X2) L6470_REPORT_CURRENT(X2); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #if AXIS_IS_L64XX(Y) L6470_REPORT_CURRENT(Y); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #if AXIS_IS_L64XX(Y2) L6470_REPORT_CURRENT(Y2); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #if AXIS_IS_L64XX(Z) L6470_REPORT_CURRENT(Z); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #if AXIS_IS_L64XX(Z2) L6470_REPORT_CURRENT(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #if AXIS_IS_L64XX(Z3) L6470_REPORT_CURRENT(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #if AXIS_IS_L64XX(E0) L6470_REPORT_CURRENT(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #if AXIS_IS_L64XX(E1) L6470_REPORT_CURRENT(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #if AXIS_IS_L64XX(E2) L6470_REPORT_CURRENT(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #if AXIS_IS_L64XX(E3) L6470_REPORT_CURRENT(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #if AXIS_IS_L64XX(E4) L6470_REPORT_CURRENT(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #if AXIS_IS_L64XX(E5) L6470_REPORT_CURRENT(E5); #endif - L6470.spi_active = false; // done with all SPI transfers - clear handshake flags - L6470.spi_abort = false; + L64xx_MARLIN.spi_active = false; // done with all SPI transfers - clear handshake flags + L64xx_MARLIN.spi_abort = false; } } -#endif // HAS_DRIVER(L6470) +#endif // HAS_L64XX diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index 590ae8c54141..88fc19781aa8 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "../../gcode.h" #include "../../../module/stepper_indirection.h" @@ -64,23 +64,23 @@ void GcodeSuite::M916() { DEBUG_ECHOLNPGM("M916"); - // Variables used by L6470_get_user_input function - some may not be used - char axis_mon[3][3] = { " ", " ", " " }; // list of Axes to be monitored - uint8_t axis_index[3]; + // Variables used by L64xx_MARLIN.get_user_input function - some may not be used + char axis_mon[3][3] = { {" "}, {" "}, {" "} }; // list of Axes to be monitored + L6470_axis_t axis_index[3]; uint16_t axis_status[3]; uint8_t driver_count = 1; float position_max; float position_min; float final_feedrate; uint8_t kval_hold; - uint8_t ocd_th_val = 0; - uint8_t stall_th_val = 0; + uint8_t OCD_TH_val = 0; + uint8_t STALL_TH_val = 0; uint16_t over_current_threshold; constexpr bool over_current_flag = false; // M916 doesn't play with the overcurrent thresholds uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L64xx_MARLIN.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold)) return; // quit if invalid user input DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate); @@ -88,12 +88,13 @@ void GcodeSuite::M916() { planner.synchronize(); // wait for all current movement commands to complete for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // clear out any pre-existing error flags + L64xx_MARLIN.get_status(axis_index[j]); // clear out any pre-existing error flags char temp_axis_string[] = " "; temp_axis_string[0] = axis_mon[0][0]; // need to have a string for use within sprintf format section char gcode_string[80]; uint16_t status_composite = 0; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; DEBUG_ECHOLNPGM(".\n."); @@ -102,7 +103,7 @@ void GcodeSuite::M916() { DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold); // set & report KVAL_HOLD for this run for (j = 0; j < driver_count; j++) - L6470.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); + L64xx_MARLIN.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); // turn the motor(s) both directions sprintf_P(gcode_string, PSTR("G0 %s%4.3f F%4.3f"), temp_axis_string, position_min, final_feedrate); @@ -117,31 +118,36 @@ void GcodeSuite::M916() { status_composite = 0; // clear out the old bits for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L6470.get_status(axis_index[j])) & L6470_ERROR_MASK; // bits of interest are all active low + axis_status[j] = (~L64xx_MARLIN.get_status(axis_index[j])) & sh.L6470_ERROR_MASK; // bits of interest are all active low status_composite |= axis_status[j] ; } - - if (status_composite && (status_composite & STATUS_UVLO)) { + if (status_composite && (status_composite & sh.STATUS_AXIS_UVLO)) { DEBUG_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j], + sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN, + sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B, + sh.STATUS_AXIS_OCD); } return; } // increment KVAL_HOLD if not yet at thermal warning/shutdown - if (!(status_composite & (STATUS_TH_WRN | STATUS_TH_SD))) + if (!(status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD))) kval_hold++; - } while (!(status_composite & (STATUS_TH_WRN | STATUS_TH_SD)) && kval_hold); // exit when kval_hold == 0 (rolls over) + } while (!(status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) && kval_hold); // exit when kval_hold == 0 (rolls over) DEBUG_ECHOPGM(".\n.\nThermal warning/shutdown "); - if ((status_composite & (STATUS_TH_WRN | STATUS_TH_SD))) { + if ((status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD))) { DEBUG_ECHOLNPGM("has occurred"); for (j = 0; j < driver_count; j++) { DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j], + sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN, + sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B, + sh.STATUS_AXIS_OCD); } } else @@ -181,29 +187,29 @@ void GcodeSuite::M917() { DEBUG_ECHOLNPGM("M917"); - char axis_mon[3][3] = { " ", " ", " " }; // list of axes to be monitored - uint8_t axis_index[3]; + char axis_mon[3][3] = { {" "}, {" "}, {" "} }; // list of Axes to be monitored + L6470_axis_t axis_index[3]; uint16_t axis_status[3]; uint8_t driver_count = 1; float position_max; float position_min; float final_feedrate; uint8_t kval_hold; - uint8_t ocd_th_val = 0; - uint8_t stall_th_val = 0; + uint8_t OCD_TH_val = 0; + uint8_t STALL_TH_val = 0; uint16_t over_current_threshold; constexpr bool over_current_flag = true; uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L64xx_MARLIN.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold)) return; // quit if invalid user input DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate); planner.synchronize(); // wait for all current movement commands to complete for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // clear out any pre-existing error flags + L64xx_MARLIN.get_status(axis_index[j]); // clear out any pre-existing error flags char temp_axis_string[] = " "; temp_axis_string[0] = axis_mon[0][0]; // need to have a string for use within sprintf format section char gcode_string[80]; @@ -214,16 +220,18 @@ void GcodeSuite::M917() { // 2 - OCD finalized - decreasing STALL - exit when STALL warning happens // 3 - OCD finalized - increasing STALL - exit when STALL warning stop // 4 - all testing completed - DEBUG_ECHOPAIR(".\n.\n.\nover_current threshold : ", (ocd_th_val + 1) * 375); // first status display - DEBUG_ECHOPAIR(" (OCD_TH: : ", ocd_th_val); - DEBUG_ECHOPAIR(") Stall threshold: ", (stall_th_val + 1) * 31.25); - DEBUG_ECHOPAIR(" (STALL_TH: ", stall_th_val); + DEBUG_ECHOPAIR(".\n.\n.\nover_current threshold : ", (OCD_TH_val + 1) * 375); // first status display + DEBUG_ECHOPAIR(" (OCD_TH: : ", OCD_TH_val); + DEBUG_ECHOPAIR(") Stall threshold: ", (STALL_TH_val + 1) * 31.25); + DEBUG_ECHOPAIR(" (STALL_TH: ", STALL_TH_val); DEBUG_ECHOLNPGM(")"); + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; + do { - DEBUG_ECHOPAIR("STALL threshold : ", (stall_th_val + 1) * 31.25); - DEBUG_ECHOLNPAIR(" OCD threshold : ", (ocd_th_val + 1) * 375); + DEBUG_ECHOPAIR("STALL threshold : ", (STALL_TH_val + 1) * 31.25); + DEBUG_ECHOLNPAIR(" OCD threshold : ", (OCD_TH_val + 1) * 375); sprintf_P(gcode_string, PSTR("G0 %s%4.3f F%4.3f"), temp_axis_string, position_min, final_feedrate); gcode.process_subcommands_now_P(gcode_string); @@ -236,20 +244,23 @@ void GcodeSuite::M917() { status_composite = 0; // clear out the old bits for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L6470.get_status(axis_index[j])) & L6470_ERROR_MASK; // bits of interest are all active low + axis_status[j] = (~L64xx_MARLIN.get_status(axis_index[j])) & sh.L6470_ERROR_MASK; // bits of interest are all active low status_composite |= axis_status[j]; } - if (status_composite && (status_composite & STATUS_UVLO)) { + if (status_composite && (status_composite & sh.STATUS_AXIS_UVLO)) { DEBUG_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j], + sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN, + sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B, + sh.STATUS_AXIS_OCD); } return; } - if (status_composite & (STATUS_TH_WRN | STATUS_TH_SD)) { + if (status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) { DEBUG_ECHOLNPGM("thermal problem - waiting for chip(s) to cool down "); uint16_t status_composite_temp = 0; uint8_t k = 0; @@ -257,10 +268,10 @@ void GcodeSuite::M917() { k++; if (!(k % 4)) { kval_hold *= 0.95; - L6470_EOL(); + DEBUG_EOL(); DEBUG_ECHOLNPAIR("Lowering KVAL_HOLD by about 5% to ", kval_hold); for (j = 0; j < driver_count; j++) - L6470.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); + L64xx_MARLIN.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); } DEBUG_ECHOLNPGM("."); gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered @@ -268,33 +279,33 @@ void GcodeSuite::M917() { safe_delay(5000); status_composite_temp = 0; for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L6470.get_status(axis_index[j])) & L6470_ERROR_MASK; // bits of interest are all active low + axis_status[j] = (~L64xx_MARLIN.get_status(axis_index[j])) & sh.L6470_ERROR_MASK; // bits of interest are all active low status_composite_temp |= axis_status[j]; } } - while (status_composite_temp & (STATUS_TH_WRN | STATUS_TH_SD)); - L6470_EOL(); + while (status_composite_temp & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)); + DEBUG_EOL(); } - if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B | STATUS_OCD)) { + if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B | sh.STATUS_AXIS_OCD)) { switch (test_phase) { case 0: { - if (status_composite & STATUS_OCD) { + if (status_composite & sh.STATUS_AXIS_OCD) { // phase 0 with OCD warning - time to go to next phase - if (ocd_th_val >=15) { - ocd_th_val = 15; // limit to max + if (OCD_TH_val >= sh.AXIS_OCD_TH_MAX) { + OCD_TH_val = sh.AXIS_OCD_TH_MAX; // limit to max test_phase = 2; // at highest value so skip phase 1 DEBUG_ECHOLNPGM("LOGIC E0A OCD at highest - skip to 2"); } else { - ocd_th_val++; // normal exit to next phase + OCD_TH_val++; // normal exit to next phase test_phase = 1; // setup for first pass of phase 1 DEBUG_ECHOLNPGM("LOGIC E0B - inc OCD & go to 1"); } } else { // phase 0 without OCD warning - keep on decrementing if can - if (ocd_th_val) { - ocd_th_val--; // try lower value + if (OCD_TH_val) { + OCD_TH_val--; // try lower value DEBUG_ECHOLNPGM("LOGIC E0C - dec OCD"); } else { @@ -305,15 +316,15 @@ void GcodeSuite::M917() { } break; case 1: { - if (status_composite & STATUS_OCD) { + if (status_composite & sh.STATUS_AXIS_OCD) { // phase 1 with OCD warning - increment if can - if (ocd_th_val >= 15) { - ocd_th_val = 15; // limit to max + if (OCD_TH_val >= sh.AXIS_OCD_TH_MAX) { + OCD_TH_val = sh.AXIS_OCD_TH_MAX; // limit to max test_phase = 2; // at highest value so go to next phase DEBUG_ECHOLNPGM("LOGIC E1A - OCD at max - go to 2"); } else { - ocd_th_val++; // try a higher value + OCD_TH_val++; // try a higher value DEBUG_ECHOLNPGM("LOGIC E1B - inc OCD"); } } @@ -324,23 +335,23 @@ void GcodeSuite::M917() { } break; case 2: { - if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) { + if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B)) { // phase 2 with stall warning - time to go to next phase - if (stall_th_val >= 127) { - stall_th_val = 127; // limit to max + if (STALL_TH_val >= 127) { + STALL_TH_val = 127; // limit to max DEBUG_ECHOLNPGM("LOGIC E2A - STALL warning, STALL at max, quit"); DEBUG_ECHOLNPGM("finished - STALL at maximum value but still have stall warning"); test_phase = 4; } else { test_phase = 3; // normal exit to next phase (found failing value of STALL) - stall_th_val++; // setup for first pass of phase 3 + STALL_TH_val++; // setup for first pass of phase 3 DEBUG_ECHOLNPGM("LOGIC E2B - INC - STALL warning, inc Stall, go to 3"); } } else { // phase 2 without stall warning - decrement if can - if (stall_th_val) { - stall_th_val--; // try a lower value + if (STALL_TH_val) { + STALL_TH_val--; // try a lower value DEBUG_ECHOLNPGM("LOGIC E2C - no STALL, dec STALL"); } else { @@ -352,16 +363,16 @@ void GcodeSuite::M917() { } break; case 3: { - if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) { + if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B)) { // phase 3 with stall warning - increment if can - if (stall_th_val >= 127) { - stall_th_val = 127; // limit to max + if (STALL_TH_val >= 127) { + STALL_TH_val = 127; // limit to max DEBUG_ECHOLNPGM("finished - STALL at maximum value but still have stall warning"); test_phase = 4; DEBUG_ECHOLNPGM("LOGIC E3A - STALL, at max so quit"); } else { - stall_th_val++; // still looking for passing value + STALL_TH_val++; // still looking for passing value DEBUG_ECHOLNPGM("LOGIC E3B - STALL, inc stall"); } } @@ -378,8 +389,8 @@ void GcodeSuite::M917() { else { switch (test_phase) { case 0: { // phase 0 without OCD warning - keep on decrementing if can - if (ocd_th_val) { - ocd_th_val--; // try lower value + if (OCD_TH_val) { + OCD_TH_val--; // try lower value DEBUG_ECHOLNPGM("LOGIC N0A - DEC OCD"); } else { @@ -391,8 +402,8 @@ void GcodeSuite::M917() { case 1: DEBUG_ECHOLNPGM("LOGIC N1 (go directly to 2)"); // phase 1 without OCD warning - drop directly to phase 2 case 2: { // phase 2 without stall warning - keep on decrementing if can - if (stall_th_val) { - stall_th_val--; // try a lower value (stay in phase 2) + if (STALL_TH_val) { + STALL_TH_val--; // try a lower value (stay in phase 2) DEBUG_ECHOLNPGM("LOGIC N2B - dec STALL"); } else { @@ -410,10 +421,10 @@ void GcodeSuite::M917() { if (test_phase != 4) { for (j = 0; j < driver_count; j++) { // update threshold(s) - L6470.set_param(axis_index[j], L6470_OCD_TH, ocd_th_val); - L6470.set_param(axis_index[j], L6470_STALL_TH, stall_th_val); - if (L6470.get_param(axis_index[j], L6470_OCD_TH) != ocd_th_val) DEBUG_ECHOLNPGM("OCD mismatch"); - if (L6470.get_param(axis_index[j], L6470_STALL_TH) != stall_th_val) DEBUG_ECHOLNPGM("STALL mismatch"); + L64xx_MARLIN.set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val); + L64xx_MARLIN.set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val); + if (L64xx_MARLIN.get_param(axis_index[j], L6470_OCD_TH) != OCD_TH_val) DEBUG_ECHOLNPGM("OCD mismatch"); + if (L64xx_MARLIN.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) DEBUG_ECHOLNPGM("STALL mismatch"); } } @@ -423,7 +434,10 @@ void GcodeSuite::M917() { DEBUG_ECHOLNPGM("Completed with errors"); for (j = 0; j < driver_count; j++) { DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j], + sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN, + sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B, + sh.STATUS_AXIS_OCD); } } else @@ -453,21 +467,23 @@ void GcodeSuite::M918() { DEBUG_ECHOLNPGM("M918"); - char axis_mon[3][3] = { " ", " ", " " }; // List of axes to monitor - uint8_t axis_index[3]; + char axis_mon[3][3] = { {" "}, {" "}, {" "} }; // list of Axes to be monitored + L6470_axis_t axis_index[3]; uint16_t axis_status[3]; uint8_t driver_count = 1; float position_max, position_min; float final_feedrate; uint8_t kval_hold; - uint8_t ocd_th_val = 0; - uint8_t stall_th_val = 0; + uint8_t OCD_TH_val = 0; + uint8_t STALL_TH_val = 0; uint16_t over_current_threshold; constexpr bool over_current_flag = true; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; + uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L64xx_MARLIN.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold)) return; // quit if invalid user input uint8_t m_steps = parser.byteval('M'); @@ -493,7 +509,7 @@ void GcodeSuite::M918() { } for (j = 0; j < driver_count; j++) - L6470.set_param(axis_index[j], L6470_STEP_MODE, m_bits); // set microsteps + L64xx_MARLIN.set_param(axis_index[j], L6470_STEP_MODE, m_bits); // set microsteps DEBUG_ECHOLNPAIR("target (maximum) feedrate = ",final_feedrate); @@ -503,11 +519,11 @@ void GcodeSuite::M918() { planner.synchronize(); // wait for all current movement commands to complete for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // clear all error flags + L64xx_MARLIN.get_status(axis_index[j]); // clear all error flags - char temp_axis_string[2]; + char temp_axis_string[2] = " "; temp_axis_string[0] = axis_mon[0][0]; // need to have a string for use within sprintf format section - temp_axis_string[1] = '\n'; + //temp_axis_string[1] = '\n'; char gcode_string[80]; uint16_t status_composite = 0; @@ -526,23 +542,26 @@ void GcodeSuite::M918() { planner.synchronize(); for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L6470.get_status(axis_index[j])) & 0x0800; // bits of interest are all active low + axis_status[j] = (~L64xx_MARLIN.get_status(axis_index[j])) & 0x0800; // bits of interest are all active low status_composite |= axis_status[j]; } if (status_composite) break; // quit if any errors flags are raised } while (current_feedrate < final_feedrate * 0.99); - DEBUG_ECHOPGM("Completed with errors"); + DEBUG_ECHOPGM("Completed with "); if (status_composite) { DEBUG_ECHOLNPGM("errors"); for (j = 0; j < driver_count; j++) { + DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j], + sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN, + sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B, + sh.STATUS_AXIS_OCD); } } else DEBUG_ECHOLNPGM("no errors"); - } // M918 -#endif // HAS_DRIVER(L6470) +#endif // HAS_L64XX diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index dc40a4a88735..652cfc53a902 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -702,7 +702,7 @@ void GcodeSuite::process_parsed_command( #endif #endif - #if HAS_DRIVER(L6470) + #if HAS_L64XX case 122: M122(); break; // M122: Report status case 906: M906(); break; // M906: Set or get motor drive level case 916: M916(); break; // M916: L6470 tuning: Increase drive level until thermal warning diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index dcd015c2bb0d..ef6ad34a1bcc 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -837,7 +837,7 @@ class GcodeSuite { #endif #endif - #if HAS_DRIVER(L6470) + #if HAS_L64XX static void M122(); static void M906(); static void M916(); diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 57ba258333a3..1ec88b831ee2 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -28,10 +28,8 @@ #if ENABLED(M114_DETAIL) - #if HAS_DRIVER(L6470) - //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\gcode\host\M114.cpp - //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\module\bob_L6470.cpp - #include "../../module/L6470/L6470_Marlin.h" + #if HAS_L64XX + #include "../../libs/L6470/L6470_Marlin.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../core/debug_out.h" #endif @@ -87,13 +85,13 @@ planner.synchronize(); - #if HAS_DRIVER(L6470) + #if HAS_L64XX char temp_buf[80]; int32_t temp; //#define ABS_POS_SIGN_MASK 0b1111 1111 1110 0000 0000 0000 0000 0000 #define ABS_POS_SIGN_MASK 0b11111111111000000000000000000000 #define REPORT_ABSOLUTE_POS(Q) do{ \ - L6470.say_axis(Q, false); \ + L64xx_MARLIN.say_axis(Q, false); \ temp = L6470_GETPARAM(L6470_ABS_POS,Q); \ if (temp & ABS_POS_SIGN_MASK) temp |= ABS_POS_SIGN_MASK; \ sprintf_P(temp_buf, PSTR(":%8ld "), temp); \ @@ -101,47 +99,47 @@ }while(0) DEBUG_ECHOPGM("\nL6470:"); - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) REPORT_ABSOLUTE_POS(X); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #if AXIS_IS_L64XX(X2) REPORT_ABSOLUTE_POS(X2); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #if AXIS_IS_L64XX(Y) REPORT_ABSOLUTE_POS(Y); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #if AXIS_IS_L64XX(Y2) REPORT_ABSOLUTE_POS(Y2); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #if AXIS_IS_L64XX(Z) REPORT_ABSOLUTE_POS(Z); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #if AXIS_IS_L64XX(Z2) REPORT_ABSOLUTE_POS(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #if AXIS_IS_L64XX(Z3) REPORT_ABSOLUTE_POS(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #if AXIS_IS_L64XX(E0) REPORT_ABSOLUTE_POS(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #if AXIS_IS_L64XX(E1) REPORT_ABSOLUTE_POS(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #if AXIS_IS_L64XX(E2) REPORT_ABSOLUTE_POS(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #if AXIS_IS_L64XX(E3) REPORT_ABSOLUTE_POS(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #if AXIS_IS_L64XX(E4) REPORT_ABSOLUTE_POS(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #if AXIS_IS_L64XX(E5) REPORT_ABSOLUTE_POS(E5); #endif SERIAL_EOL(); - #endif // HAS_DRIVER(L6470) + #endif // HAS_L64XX SERIAL_ECHOPGM("Stepper:"); LOOP_XYZE(i) { diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index d82f238097cc..3c7b03d76e8a 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1666,7 +1666,7 @@ // If platform requires early initialization of watchdog to properly boot #define EARLY_WATCHDOG (ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM)) -#define USE_EXECUTE_COMMANDS_IMMEDIATE (ANY(G29_RETRY_AND_RECOVER, GCODE_MACROS, POWER_LOSS_RECOVERY) || HAS_DRIVER(L6470)) +#define USE_EXECUTE_COMMANDS_IMMEDIATE (ANY(G29_RETRY_AND_RECOVER, GCODE_MACROS, POWER_LOSS_RECOVERY) || HAS_L64XX) #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) #define Z_STEPPER_COUNT 3 diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index 9e1fd2ca695d..bdcd5be8b49a 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -26,24 +26,24 @@ #include "../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "L6470_Marlin.h" -L6470_Marlin L6470; +L64XX_Marlin L64xx_MARLIN; -#include "../stepper_indirection.h" +#include "../../module/stepper_indirection.h" #include "../../gcode/gcode.h" -#include "../planner.h" +#include "../../module/planner.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../core/debug_out.h" -uint8_t L6470_Marlin::dir_commands[MAX_L6470]; // array to hold direction command for each driver +uint8_t L64XX_Marlin::dir_commands[MAX_L6470]; // array to hold direction command for each driver -char L6470_Marlin::index_to_axis[MAX_L6470][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; +char L64XX_Marlin::index_to_axis[MAX_L6470][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; -bool L6470_Marlin::index_to_dir[MAX_L6470] = { +bool L64XX_Marlin::index_to_dir[MAX_L6470] = { INVERT_X_DIR , // 0 X INVERT_Y_DIR , // 1 Y INVERT_Z_DIR , // 2 Z @@ -67,7 +67,7 @@ bool L6470_Marlin::index_to_dir[MAX_L6470] = { INVERT_E5_DIR , //12 E5 }; -uint8_t L6470_Marlin::axis_xref[MAX_L6470] = { +uint8_t L64XX_axis_xref[MAX_L6470] = { AxisEnum(X_AXIS), // X AxisEnum(Y_AXIS), // Y AxisEnum(Z_AXIS), // Z @@ -83,207 +83,254 @@ uint8_t L6470_Marlin::axis_xref[MAX_L6470] = { AxisEnum(E_AXIS) // E5 }; -volatile bool L6470_Marlin::spi_abort = false; -bool L6470_Marlin::spi_active = false; +volatile bool L64XX_Marlin::spi_abort = false; +bool L64XX_Marlin::spi_active = false; -void L6470_Marlin::populate_chain_array() { +L64XX_Marlin::L64XX_shadow_t L64XX_Marlin::shadow; +void L6470_populate_chain_array() { #define _L6470_INIT_SPI(Q) do{ stepper##Q.set_chain_info(Q, Q##_CHAIN_POS); }while(0) - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) _L6470_INIT_SPI(X); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #if AXIS_IS_L64XX(X2) _L6470_INIT_SPI(X2); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #if AXIS_IS_L64XX(Y) _L6470_INIT_SPI(Y); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #if AXIS_IS_L64XX(Y2) _L6470_INIT_SPI(Y2); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #if AXIS_IS_L64XX(Z) _L6470_INIT_SPI(Z); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #if AXIS_IS_L64XX(Z2) _L6470_INIT_SPI(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #if AXIS_IS_L64XX(Z3) _L6470_INIT_SPI(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #if AXIS_IS_L64XX(E0) _L6470_INIT_SPI(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #if AXIS_IS_L64XX(E1) _L6470_INIT_SPI(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #if AXIS_IS_L64XX(E2) _L6470_INIT_SPI(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #if AXIS_IS_L64XX(E3) _L6470_INIT_SPI(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #if AXIS_IS_L64XX(E4) _L6470_INIT_SPI(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #if AXIS_IS_L64XX(E5) _L6470_INIT_SPI(E5); #endif } -void L6470_Marlin::init() { // Set up SPI and then init chips - #if PIN_EXISTS(L6470_RESET_CHAIN) - OUT_WRITE(L6470_RESET_CHAIN_PIN, LOW); // hardware reset of drivers +void L64XX_Marlin::init() { // Set up SPI and then init chips + #ifdef L6470_RESET_CHAIN_PIN + OUT_WRITE(L6470_RESET_CHAIN_PIN,0); // hardware reset of drivers delay(1); - OUT_WRITE(L6470_RESET_CHAIN_PIN, HIGH); - delay(1); // need about 650uS for the chip to fully start up + OUT_WRITE(L6470_RESET_CHAIN_PIN,1); + delay(1); // need about 650uS for the chip to fully start up #endif - populate_chain_array(); // Set up array to control where in the SPI transfer sequence a particular stepper's data goes - L6470_spi_init(); // Set up L6470 soft SPI pins - init_to_defaults(); // init the chips + L6470_populate_chain_array(); // Set up array to control where in the SPI transfer sequence a particular stepper's data goes + +// typedef void (*spi_init_handler_t)(); +// typedef uint8_t (*transfer_handler_t)(uint8_t data, const int16_t ss_pin); +// typedef uint8_t (*chain_transfer_handler_t)(uint8_t data, const int16_t ss_pin, const uint8_t chain_position); +// +//// L64XX.set_handlers(spi_init_handler_t _spi_init, transfer_handler_t _transfer, chain_transfer_handler_t _chain_transfer) +// set_handlers((spi_init_handler_t) &L64xx_MARLIN.spi_init, (transfer_handler_t) &L64xx_MARLIN.transfer_single, (chain_transfer_handler_t) &L64xx_MARLIN.transfer_chain); + + spi_init(); // Since L64XX SPI pins are unset we must init SPI here + + init_to_defaults(); // init the chips +} + +/** + * Some status bit positions & definitions change depending on the driver chip. Copy all status info into known locations + * so check/display logic is simplified + * 1. copy stepper status + * 2. copy status bit definitions + * 3. copy status layout + * 4. make all error bits active low (if needed) + */ +uint16_t L64XX_Marlin::get_stepper_status(L64XX &st) { + shadow.STATUS_AXIS_RAW = st.getStatus(); + shadow.STATUS_AXIS = shadow.STATUS_AXIS_RAW; + shadow.STATUS_AXIS_LAYOUT = st.L6470_status_layout; + shadow.AXIS_OCD_TH_MAX = st.OCD_TH_MAX; + shadow.AXIS_STALL_TH_MAX = st.STALL_TH_MAX; + shadow.AXIS_OCD_CURRENT_CONSTANT_INV = st.OCD_CURRENT_CONSTANT_INV; + shadow.AXIS_STALL_CURRENT_CONSTANT_INV = st.STALL_CURRENT_CONSTANT_INV; + shadow.L6470_AXIS_CONFIG = st.L64XX_CONFIG; + shadow.L6470_AXIS_STATUS = st.L64XX_STATUS; + shadow.STATUS_AXIS_OCD = st.STATUS_OCD; + shadow.STATUS_AXIS_SCK_MOD = st.STATUS_SCK_MOD; + shadow.STATUS_AXIS_STEP_LOSS_A = st.STATUS_STEP_LOSS_A; + shadow.STATUS_AXIS_STEP_LOSS_B = st.STATUS_STEP_LOSS_B; + shadow.STATUS_AXIS_TH_SD = st.STATUS_TH_SD; + shadow.STATUS_AXIS_TH_WRN = st.STATUS_TH_WRN; + shadow.STATUS_AXIS_UVLO = st.STATUS_UVLO; + shadow.STATUS_AXIS_WRONG_CMD = st.STATUS_WRONG_CMD; + shadow.STATUS_AXIS_CMD_ERR = st.STATUS_CMD_ERR; + shadow.STATUS_AXIS_NOTPERF_CMD = st.STATUS_NOTPERF_CMD; + shadow.L6470_ERROR_MASK = shadow.STATUS_AXIS_UVLO | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD | shadow.STATUS_AXIS_OCD | shadow.STATUS_AXIS_STEP_LOSS_A | shadow.STATUS_AXIS_STEP_LOSS_B; + shadow.STATUS_AXIS_LAYOUT = st.L6470_status_layout; + if (!shadow.STATUS_AXIS_LAYOUT) shadow.STATUS_AXIS ^= (shadow.STATUS_AXIS_TH_SD | shadow.STATUS_AXIS_TH_WRN); + return shadow.STATUS_AXIS; } -uint16_t L6470_Marlin::get_status(const uint8_t axis) { +uint16_t L64XX_Marlin::get_status(const L6470_axis_t axis) { - #define GET_L6470_STATUS(Q) stepper##Q.getStatus() + #define STATUS_L6470(Q) get_stepper_status(stepper##Q) switch (axis) { - #if AXIS_DRIVER_TYPE_X(L6470) - case 0: return GET_L6470_STATUS(X); + default: break; + #if AXIS_IS_L64XX(X) + case X : return STATUS_L6470(X); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - case 1: return GET_L6470_STATUS(Y); + #if AXIS_IS_L64XX(Y) + case Y : return STATUS_L6470(Y); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - case 2: return GET_L6470_STATUS(Z); + #if AXIS_IS_L64XX(Z) + case Z : return STATUS_L6470(Z); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - case 3: return GET_L6470_STATUS(X2); + #if AXIS_IS_L64XX(X2) + case X2: return STATUS_L6470(X2); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - case 4: return GET_L6470_STATUS(Y2); + #if AXIS_IS_L64XX(Y2) + case Y2: return STATUS_L6470(Y2); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - case 5: return GET_L6470_STATUS(Z2); + #if AXIS_IS_L64XX(Z2) + case Z2: return STATUS_L6470(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - case 6: return GET_L6470_STATUS(Z3); + #if AXIS_IS_L64XX(Z3) + case Z3: return STATUS_L6470(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - case 7: return GET_L6470_STATUS(E0); + #if AXIS_IS_L64XX(E0) + case E0: return STATUS_L6470(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 8: return GET_L6470_STATUS(E1); + #if AXIS_IS_L64XX(E1) + case E1: return STATUS_L6470(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 9: return GET_L6470_STATUS(E2); + #if AXIS_IS_L64XX(E2) + case E2: return STATUS_L6470(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 10: return GET_L6470_STATUS(E3); + #if AXIS_IS_L64XX(E3) + case E3: return STATUS_L6470(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 11: return GET_L6470_STATUS(E4); + #if AXIS_IS_L64XX(E4) + case E4: return STATUS_L6470(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 12: return GET_L6470_STATUS(E5); + #if AXIS_IS_L64XX(E5) + case E5: return STATUS_L6470(E5); #endif } return 0; // Not needed but kills a compiler warning } -uint32_t L6470_Marlin::get_param(uint8_t axis, uint8_t param) { +uint32_t L64XX_Marlin::get_param(const L6470_axis_t axis, const uint8_t param) { #define GET_L6470_PARAM(Q) L6470_GETPARAM(param,Q) switch (axis) { - #if AXIS_DRIVER_TYPE_X(L6470) - case 0: return GET_L6470_PARAM(X); + default: break; + #if AXIS_IS_L64XX(X) + case X : return GET_L6470_PARAM(X); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - case 1: return GET_L6470_PARAM(Y); + #if AXIS_IS_L64XX(Y) + case Y : return GET_L6470_PARAM(Y); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - case 2: return GET_L6470_PARAM(Z); + #if AXIS_IS_L64XX(Z) + case Z : return GET_L6470_PARAM(Z); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - case 3: return GET_L6470_PARAM(X2); + #if AXIS_IS_L64XX(X2) + case X2: return GET_L6470_PARAM(X2); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - case 4: return GET_L6470_PARAM(Y2); + #if AXIS_IS_L64XX(Y2) + case Y2: return GET_L6470_PARAM(Y2); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - case 5: return GET_L6470_PARAM(Z2); + #if AXIS_IS_L64XX(Z2) + case Z2: return GET_L6470_PARAM(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - case 6: return GET_L6470_PARAM(Z3); + #if AXIS_IS_L64XX(Z3) + case Z3: return GET_L6470_PARAM(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - case 7: return GET_L6470_PARAM(E0); + #if AXIS_IS_L64XX(E0) + case E0: return GET_L6470_PARAM(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 8: return GET_L6470_PARAM(E1); + #if AXIS_IS_L64XX(E1) + case E1: return GET_L6470_PARAM(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 9: return GET_L6470_PARAM(E2); + #if AXIS_IS_L64XX(E2) + case E2: return GET_L6470_PARAM(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 10: return GET_L6470_PARAM(E3); + #if AXIS_IS_L64XX(E3) + case E3: return GET_L6470_PARAM(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 11: return GET_L6470_PARAM(E4); + #if AXIS_IS_L64XX(E4) + case E4: return GET_L6470_PARAM(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 12: return GET_L6470_PARAM(E5); + #if AXIS_IS_L64XX(E5) + case E5: return GET_L6470_PARAM(E5); #endif } return 0 ; // not needed but kills a compiler warning } -void L6470_Marlin::set_param(uint8_t axis, uint8_t param, uint32_t value) { +void L64XX_Marlin::set_param(const L6470_axis_t axis, const uint8_t param, const uint32_t value) { #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value) switch (axis) { - #if AXIS_DRIVER_TYPE_X(L6470) - case 0: SET_L6470_PARAM(X); + default: break; + #if AXIS_IS_L64XX(X) + case X : SET_L6470_PARAM(X); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - case 1: SET_L6470_PARAM(Y); + #if AXIS_IS_L64XX(Y) + case Y : SET_L6470_PARAM(Y); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - case 2: SET_L6470_PARAM(Z); + #if AXIS_IS_L64XX(Z) + case Z : SET_L6470_PARAM(Z); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - case 3: SET_L6470_PARAM(X2); + #if AXIS_IS_L64XX(X2) + case X2: SET_L6470_PARAM(X2); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - case 4: SET_L6470_PARAM(Y2); + #if AXIS_IS_L64XX(Y2) + case Y2: SET_L6470_PARAM(Y2); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - case 5: SET_L6470_PARAM(Z2); + #if AXIS_IS_L64XX(Z2) + case Z2: SET_L6470_PARAM(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - case 6: SET_L6470_PARAM(Z3); + #if AXIS_IS_L64XX(Z3) + case Z3: SET_L6470_PARAM(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - case 7: SET_L6470_PARAM(E0); + #if AXIS_IS_L64XX(E0) + case E0: SET_L6470_PARAM(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 8: SET_L6470_PARAM(E1); + #if AXIS_IS_L64XX(E1) + case E1: SET_L6470_PARAM(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 9: SET_L6470_PARAM(E2); + #if AXIS_IS_L64XX(E2) + case E2: SET_L6470_PARAM(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 10: SET_L6470_PARAM(E3); + #if AXIS_IS_L64XX(E3) + case E3: SET_L6470_PARAM(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 11: SET_L6470_PARAM(E4); + #if AXIS_IS_L64XX(E4) + case E4: SET_L6470_PARAM(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 12: SET_L6470_PARAM(E5); + #if AXIS_IS_L64XX(E5) + case E5: SET_L6470_PARAM(E5); #endif } } @@ -300,9 +347,9 @@ inline void echo_oct_used(const float &oct, const bool stall) { } inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("ERROR - motion out of bounds"); } -bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], char axis_mon[3][3], - float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, - bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold +bool L64XX_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char axis_mon[3][3], + float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, + bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold ) { // Return TRUE if the calling routine needs to abort/kill @@ -320,16 +367,19 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], axis_mon[0][0] = axis_codes[i]; // axis ASCII value (target character) if (axis_offset >= 2 || axis_mon[0][0] == 'E') // Single axis, E0, or E1 axis_mon[0][1] = axis_offset + '0'; - else if (axis_offset == 0) { // one or more axes - uint8_t driver_count_local = 0; // can't use "driver_count" directly as a subscript because it's passed by reference - for (j = 0; j < MAX_L6470; j++) // see how many drivers on this axis - if (axis_mon[0][0] == index_to_axis[j][0]) { - axis_mon[driver_count_local][0] = axis_mon[0][0]; - axis_mon[driver_count_local][1] = index_to_axis[j][1]; - axis_mon[driver_count_local][2] = index_to_axis[j][2]; // append end of string - axis_index[driver_count_local] = j; // set axis index + else if (axis_offset == 0) { // One or more axes + uint8_t driver_count_local = 0; // Can't use "driver_count" directly as a subscript because it's passed by reference + for (j = 0; j < MAX_L6470; j++) { // See how many drivers on this axis + const char * const str = index_to_axis[j]; + if (axis_mon[0][0] == str[0]) { + char * const mon = axis_mon[driver_count_local]; + mon[0] = str[0]; + mon[1] = str[1]; + mon[2] = str[2]; // append end of string + axis_index[driver_count_local] = (L6470_axis_t)j; // set axis index driver_count_local++; } + } driver_count = driver_count_local; } break; // only take first axis found @@ -339,19 +389,17 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], // Position calcs & checks // - const float center[] = { - LOGICAL_X_POSITION(current_position[X_AXIS]), - LOGICAL_Y_POSITION(current_position[Y_AXIS]), - LOGICAL_Z_POSITION(current_position[Z_AXIS]), - current_position[E_AXIS] - }; + const float X_center = LOGICAL_X_POSITION(current_position[X_AXIS]), + Y_center = LOGICAL_Y_POSITION(current_position[Y_AXIS]), + Z_center = LOGICAL_Z_POSITION(current_position[Z_AXIS]), + E_center = current_position[E_AXIS]; switch (axis_mon[0][0]) { default: position_max = position_min = 0; break; case 'X': { - position_min = center[X_AXIS] - displacement; - position_max = center[X_AXIS] + displacement; + position_min = X_center - displacement; + position_max = X_center + displacement; echo_min_max('X', position_min, position_max); if (false #ifdef X_MIN_POS @@ -367,8 +415,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], } break; case 'Y': { - position_min = center[Y_AXIS] - displacement; - position_max = center[Y_AXIS] + displacement; + position_min = Y_center - displacement; + position_max = Y_center + displacement; echo_min_max('Y', position_min, position_max); if (false #ifdef Y_MIN_POS @@ -384,8 +432,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], } break; case 'Z': { - position_min = center[E_AXIS] - displacement; - position_max = center[E_AXIS] + displacement; + position_min = Z_center - displacement; + position_max = Z_center + displacement; echo_min_max('Z', position_min, position_max); if (false #ifdef Z_MIN_POS @@ -401,8 +449,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], } break; case 'E': { - position_min = center[E_AXIS] - displacement; - position_max = center[E_AXIS] + displacement; + position_min = E_center - displacement; + position_max = E_center + displacement; echo_min_max('E', position_min, position_max); } break; } @@ -412,8 +460,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], // for (uint8_t k = 0; k < driver_count; k++) { bool not_found = true; - for (j = 1; j <= L6470::chain[0]; j++) { - const char * const ind_axis = index_to_axis[L6470::chain[j]]; + for (j = 1; j <= L64XX::chain[0]; j++) { + const char * const ind_axis = index_to_axis[L64XX::chain[j]]; if (ind_axis[0] == axis_mon[k][0] && ind_axis[1] == axis_mon[k][1]) { // See if a L6470 driver not_found = false; break; @@ -433,7 +481,7 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], DEBUG_ECHOPGM("Monitoring:"); for (j = 0; j < driver_count; j++) DEBUG_ECHOPAIR(" ", axis_mon[j]); - L6470_EOL(); + DEBUG_EOL(); // now have a list of driver(s) to monitor @@ -537,28 +585,43 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR("YES") : PSTR("NO ")); } #endif -void L6470_Marlin::say_axis(const uint8_t axis, const bool label/*=true*/) { +/* +char* L64XX_Marlin::index_to_axis(const uint8_t index) { + static PGM_P const _axis_string[MAX_L6470] = PROGMEM { + PSTR("X "), PSTR("Y "), PSTR("Z "), + PSTR("X2"), PSTR("Y2"), PSTR("Z2"), PSTR("Z3"), + PSTR("E0"), PSTR("E1"), PSTR("E2"), PSTR("E3"), PSTR("E4"), PSTR("E5") + }; + return (char*)pgm_read_ptr(&_axis_string[index]); +} +*/ + +void L64XX_Marlin::say_axis(const L6470_axis_t axis, const bool label/*=true*/) { if (label) SERIAL_ECHOPGM("AXIS:"); + const char * const str = index_to_axis[axis]; SERIAL_CHAR(' '); - SERIAL_CHAR(index_to_axis[axis][0]); - SERIAL_CHAR(index_to_axis[axis][1]); + SERIAL_CHAR(str[0]); + SERIAL_CHAR(str[1]); SERIAL_CHAR(' '); } -void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis) { // assumes status bits have been inverted +void L64XX_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t axis, + const uint16_t _status_axis_th_sd, const uint16_t _status_axis_th_wrn, + const uint16_t _status_axis_step_loss_a, const uint16_t _status_axis_step_loss_b, + const uint16_t _status_axis_ocd) { // assumes status bits have been inverted #if ENABLED(L6470_CHITCHAT) char temp_buf[10]; - say_axis(axis); + L64xx_MARLIN.say_axis(axis); sprintf_P(temp_buf, PSTR(" %4x "), status); DEBUG_ECHO(temp_buf); print_bin(status); DEBUG_ECHOPGM(" THERMAL: "); - serialprintPGM((status & STATUS_TH_SD) ? PSTR("SHUTDOWN") : (status & STATUS_TH_WRN) ? PSTR("WARNING ") : PSTR("OK ")); + serialprintPGM((status & _status_axis_th_sd) ? PSTR("SHUTDOWN") : (status & _status_axis_th_wrn) ? PSTR("WARNING ") : PSTR("OK ")); DEBUG_ECHOPGM(" OVERCURRENT: "); - echo_yes_no(status & STATUS_OCD); + echo_yes_no(status & _status_axis_ocd); DEBUG_ECHOPGM(" STALL: "); - echo_yes_no(status & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)); - L6470_EOL(); + echo_yes_no(status & (_status_axis_step_loss_a | _status_axis_step_loss_b)); + DEBUG_EOL(); #else UNUSED(status); UNUSED(axis); #endif @@ -570,7 +633,7 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis //// ////////////////////////////////////////////////////////////////////////////////////////////////// -#if ENABLED(MONITOR_L6470_DRIVER_STATUS) +#ifdef MONITOR_L6470_DRIVER_STATUS struct L6470_driver_data { uint8_t driver_index; @@ -583,59 +646,66 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis }; L6470_driver_data driver_L6470_data[] = { - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) { 0, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #if AXIS_IS_L64XX(Y) { 1, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #if AXIS_IS_L64XX(Z) { 2, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #if AXIS_IS_L64XX(X2) { 3, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #if AXIS_IS_L64XX(Y2) { 4, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #if AXIS_IS_L64XX(Z2) { 5, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #if AXIS_IS_L64XX(Z3) { 6, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #if AXIS_IS_L64XX(E0) { 7, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #if AXIS_IS_L64XX(E1) { 8, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #if AXIS_IS_L64XX(E2) { 9, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #if AXIS_IS_L64XX(E3) { 10, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #if AXIS_IS_L64XX(E4) { 11, 0, 0, 0, 0, 0, 0 }, #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #if AXIS_IS_L64XX(E5) { 12, 0, 0, 0, 0, 0, 0 } #endif }; - inline void append_stepper_err(char * &p, const uint8_t stepper_index, const char * const err=NULL) { - p += sprintf_P(p, PSTR("Stepper %c%c "), char(index_to_axis[stepper_index][0]), char(index_to_axis[stepper_index][1])); - if (err) p += sprintf_P(p, err); + inline void append_stepper_err(char * &p, const uint8_t stepper_index) { + const char * const str = L64xx_MARLIN.index_to_axis[stepper_index]; + strcpy_P(p, PSTR("Stepper ")); + p[8] = str[0]; p[9] = str[1]; p[10] = ' '; p[11] = '\0'; + p += 11; } - void L6470_monitor_update(uint8_t stepper_index, uint16_t status) { + inline void append_stepper_err(char * &p, const uint8_t stepper_index, const char * const err) { + append_stepper_err(p, stepper_index); + if (err) p += sprintf_P(p, err, NULL); + } + + void L64XX_Marlin::monitor_update(uint8_t stepper_index, uint16_t status) { if (spi_abort) return; // don't do anything if set_directions() has occurred uint8_t kval_hold; char temp_buf[120]; char* p = &temp_buf[0]; uint8_t j; - for (j = 0; j < L6470::chain[0]; j++) // find the table for this stepper + for (j = 0; j < L64XX::chain[0]; j++) // find the table for this stepper if (driver_L6470_data[j].driver_index == stepper_index) break; driver_L6470_data[j].driver_status = status; @@ -665,14 +735,14 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis } else { // no com problems - do the usual checks - if (_status & L6470_ERROR_MASK) { + if (_status & shadow.L6470_ERROR_MASK) { append_stepper_err(p, stepper_index); - if (status & STATUS_HIZ) { // the driver has shut down HiZ is active high + if (status & STATUS_HIZ) { // The driver has shut down. HiZ is active high driver_L6470_data[j].is_hi_Z = true; p += sprintf_P(p, PSTR("%cIS SHUT DOWN"), ' '); - // if (_status & STATUS_TH_SD) { // strange - TH_SD never seems to go active, must be implied by the HiZ and TH_WRN - if (_status & STATUS_TH_WRN) { // over current shutdown + //if (_status & shadow.STATUS_AXIS_TH_SD) { // strange - TH_SD never seems to go active, must be implied by the HiZ and TH_WRN + if (_status & shadow.STATUS_AXIS_TH_WRN) { // over current shutdown p += sprintf_P(p, PSTR("%cdue to over temperature"), ' '); driver_L6470_data[j].is_ot = true; kval_hold = get_param(stepper_index, L6470_KVAL_HOLD) - 2 * KVAL_HOLD_STEP_DOWN; @@ -685,7 +755,7 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis else { driver_L6470_data[j].is_hi_Z = false; - if (_status & STATUS_TH_WRN) { // have an over temperature warning + if (_status & shadow.STATUS_AXIS_TH_WRN) { // have an over temperature warning driver_L6470_data[j].is_otw = true; driver_L6470_data[j].otw_counter++; kval_hold = get_param(stepper_index, L6470_KVAL_HOLD); @@ -701,22 +771,20 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis } } - #ifdef L6470_STOP_ON_ERROR - if (_status & (STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD)) - kill(temp_buf); + #if ENABLED(L6470_STOP_ON_ERROR) + if (_status & (shadow.STATUS_AXIS_UVLO | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD)) + kill(temp_buf); #endif - #if ENABLED(L6470_CHITCHAT) + if (_status & shadow.STATUS_AXIS_OCD) + p += sprintf_P(p, PSTR("%c over current"), ' '); - if (_status & STATUS_OCD) - p += sprintf_P(p, PSTR("%c over current"), ' '); + if (_status & (shadow.STATUS_AXIS_STEP_LOSS_A | shadow.STATUS_AXIS_STEP_LOSS_B)) + p += sprintf_P(p, PSTR("%c stall"), ' '); - if (_status & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) - p += sprintf_P(p, PSTR("%c stall"), ' '); - - if (_status & STATUS_UVLO) - p += sprintf_P(p, PSTR("%c under voltage lock out"), ' '); + if (_status & shadow.STATUS_AXIS_UVLO) + p += sprintf_P(p, PSTR("%c under voltage lock out"), ' '); p += sprintf_P(p, PSTR("%c\n"), ' '); #endif @@ -727,63 +795,63 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis driver_L6470_data[j].is_ot = false; driver_L6470_data[j].otw_counter = 0; //clear out warning indicators driver_L6470_data[j].is_otw = false; - } // end usual checks - } // comms established but have errors - } // comms re-established - } // end L6470_monitor_update() - #define MONITOR_L6470_DRIVE(Q) L6470_monitor_update(Q, stepper##Q.getStatus()) + }// comms established but have errors + } // comms re-established + } // end monitor_update() - void L6470_Marlin::monitor_driver() { + void L64XX_Marlin::monitor_driver() { static millis_t next_cOT = 0; if (ELAPSED(millis(), next_cOT)) { next_cOT = millis() + 500; spi_active = true; // let set_directions() know we're in the middle of a series of SPI transfers - #if AXIS_DRIVER_TYPE_X(L6470) + #define MONITOR_L6470_DRIVE(Q) monitor_update(Q, stepper##Q.getStatus()) + + #if AXIS_IS_L64XX(X) MONITOR_L6470_DRIVE(X); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #if AXIS_IS_L64XX(Y) MONITOR_L6470_DRIVE(Y); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #if AXIS_IS_L64XX(Z) MONITOR_L6470_DRIVE(Z); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #if AXIS_IS_L64XX(X2) MONITOR_L6470_DRIVE(X2); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #if AXIS_IS_L64XX(Y2) MONITOR_L6470_DRIVE(Y2); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #if AXIS_IS_L64XX(Z2) MONITOR_L6470_DRIVE(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #if AXIS_IS_L64XX(Z3) MONITOR_L6470_DRIVE(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #if AXIS_IS_L64XX(E0) MONITOR_L6470_DRIVE(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #if AXIS_IS_L64XX(E1) MONITOR_L6470_DRIVE(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #if AXIS_IS_L64XX(E2) MONITOR_L6470_DRIVE(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #if AXIS_IS_L64XX(E3) MONITOR_L6470_DRIVE(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #if AXIS_IS_L64XX(E4) MONITOR_L6470_DRIVE(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #if AXIS_IS_L64XX(E5) MONITOR_L6470_DRIVE(E5); #endif #if ENABLED(L6470_DEBUG) - if (report_L6470_status) L6470_EOL(); + if (report_L6470_status) DEBUG_EOL(); #endif spi_active = false; // done with all SPI transfers - clear handshake flags @@ -793,4 +861,4 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis #endif // MONITOR_L6470_DRIVER_STATUS -#endif // HAS_DRIVER(L6470) +#endif // HAS_L64XX diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index 43ebd6ef08f1..454afe32317b 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -29,46 +29,88 @@ #define MAX_L6470 (7 + MAX_EXTRUDERS) // Maximum number of axes in Marlin -#define L6470_ERROR_MASK (STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD | STATUS_OCD | STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B) #define dSPIN_STEP_CLOCK_FWD dSPIN_STEP_CLOCK #define dSPIN_STEP_CLOCK_REV dSPIN_STEP_CLOCK+1 -#define HAS_L6470_EXTRUDER ( AXIS_DRIVER_TYPE_E0(L6470) || AXIS_DRIVER_TYPE_E1(L6470) || AXIS_DRIVER_TYPE_E2(L6470) \ - || AXIS_DRIVER_TYPE_E3(L6470) || AXIS_DRIVER_TYPE_E4(L6470) || AXIS_DRIVER_TYPE_E5(L6470) ) +#define HAS_L64XX_EXTRUDER (AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5)) -class L6470_Marlin { +extern uint8_t L6470_SpiTransfer_Mode_3(uint8_t b); + +typedef enum : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 } L6470_axis_t; + +class L64XX_Marlin { public: - static bool index_to_dir[MAX_L6470]; - static uint8_t axis_xref[MAX_L6470]; static char index_to_axis[MAX_L6470][3]; + + static bool index_to_dir[MAX_L6470]; static uint8_t dir_commands[MAX_L6470]; // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer static volatile bool spi_abort; static bool spi_active; - L6470_Marlin() {} + L64XX_Marlin() {} - static uint16_t get_status(const uint8_t axis); + static void init(); + static void init_to_defaults(); - static uint32_t get_param(uint8_t axis, uint8_t param); + static uint16_t get_stepper_status(L64XX &st); - static void set_param(uint8_t axis, uint8_t param, uint32_t value); + static uint16_t get_status(const L6470_axis_t axis); - static bool get_user_input(uint8_t &driver_count, uint8_t axis_index[3], char axis_mon[3][3], - float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, - bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold); + static uint32_t get_param(const L6470_axis_t axis, const uint8_t param); - static void error_status_decode(const uint16_t status, const uint8_t axis); + static void set_param(const L6470_axis_t axis, const uint8_t param, const uint32_t value); - static void monitor_driver(); + //static void send_command(const L6470_axis_t axis, uint8_t command); - static void init(); - static void init_to_defaults(); + static bool get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char axis_mon[3][3], + float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, + bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold); + + static void monitor_update(uint8_t stepper_index, uint16_t status); + + static void monitor_driver(); - static void say_axis(const uint8_t axis, const bool label=true); + static void transfer(uint8_t L6470_buf[], const uint8_t length); + + //static char* index_to_axis(const uint8_t index); + static void say_axis(const L6470_axis_t axis, const bool label=true); + static void error_status_decode(const uint16_t status, const L6470_axis_t axis, + const uint16_t _status_axis_th_sd, const uint16_t _status_axis_th_wrn, + const uint16_t _status_axis_step_loss_a, const uint16_t _status_axis_step_loss_b, + const uint16_t _status_axis_ocd); + + // ~40 bytes SRAM to simplify status decode routines + typedef struct { + bool STATUS_AXIS_LAYOUT; // Copy of L6470_status_layout + uint8_t AXIS_OCD_TH_MAX; // Size of OCD_TH field + uint8_t AXIS_STALL_TH_MAX; // Size of STALL_TH field + float AXIS_OCD_CURRENT_CONSTANT_INV; // mA per count + float AXIS_STALL_CURRENT_CONSTANT_INV; // mA per count + uint8_t L6470_AXIS_CONFIG, // Address of the CONFIG register + L6470_AXIS_STATUS; // Address of the STATUS register + uint16_t L6470_ERROR_MASK, // STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD | STATUS_OCD | STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B + STATUS_AXIS_RAW, // Copy of status register contents + STATUS_AXIS, // Copy of status register contents but with all error bits active low + STATUS_AXIS_OCD, // Overcurrent detected bit position + STATUS_AXIS_SCK_MOD, // Step clock mode is active bit position + STATUS_AXIS_STEP_LOSS_A, // Stall detected on A bridge bit position + STATUS_AXIS_STEP_LOSS_B, // Stall detected on B bridge bit position + STATUS_AXIS_TH_SD, // Thermal shutdown bit position + STATUS_AXIS_TH_WRN, // Thermal warning bit position + STATUS_AXIS_UVLO, // Undervoltage lockout is active bit position + STATUS_AXIS_WRONG_CMD, // Last command not valid bit position + STATUS_AXIS_CMD_ERR, // Command error bit position + STATUS_AXIS_NOTPERF_CMD; // Last command not performed bit position + } L64XX_shadow_t; + + static L64XX_shadow_t shadow; + +//protected: + static void spi_init(); + static uint8_t transfer_single(uint8_t data, int16_t ss_pin); + static uint8_t transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain_position); -private: - void populate_chain_array(); }; -extern L6470_Marlin L6470; +extern L64XX_Marlin L64xx_MARLIN; diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index ce3141c12ff3..d7b11ac50bcb 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -101,6 +101,12 @@ Stepper stepper; // Singleton #include "../Marlin.h" #include "../HAL/shared/Delay.h" +#if HAS_L64XX + #include "../libs/L6470/L6470_Marlin.h" + uint8_t L6470_buf[MAX_L6470 + 1]; // chip command sequence - element 0 not used + bool L64XX_OK_to_power_up = false; // flag to keep L64xx steppers powered down after a reset or power up +#endif + #if MB(ALLIGATOR) #include "../feature/dac/dac_dac084s085.h" #endif @@ -117,10 +123,6 @@ Stepper stepper; // Singleton #include "../feature/runout.h" #endif -#if HAS_DRIVER(L6470) - #include "../libs/L6470/L6470_Marlin.h" -#endif - // public: #if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) @@ -350,10 +352,6 @@ void Stepper::wake_up() { */ void Stepper::set_directions() { - #if HAS_DRIVER(L6470) - uint8_t L6470_buf[MAX_L6470 + 1]; // chip command sequence - element 0 not used - #endif - #define SET_STEP_DIR(A) \ if (motor_direction(_AXIS(A))) { \ A##_APPLY_DIR(INVERT_## A##_DIR, false); \ @@ -400,25 +398,25 @@ void Stepper::set_directions() { #endif #endif // !LIN_ADVANCE - #if HAS_DRIVER(L6470) - - if (L6470.spi_active) { - L6470.spi_abort = true; // interrupted a SPI transfer - need to shut it down gracefully - for (uint8_t j = 1; j <= L6470::chain[0]; j++) - L6470_buf[j] = dSPIN_NOP; // fill buffer with NOOP commands - L6470.transfer(L6470_buf, L6470::chain[0]); // send enough NOOPs to complete any command - L6470.transfer(L6470_buf, L6470::chain[0]); - L6470.transfer(L6470_buf, L6470::chain[0]); - } - - // The L6470.dir_commands[] array holds the direction command for each stepper + #if HAS_L64XX + if (L64XX_OK_to_power_up) { // OK to send the direction commands (which powers up the L64XX steppers) + if (L64xx_MARLIN.spi_active) { + L64xx_MARLIN.spi_abort = true; // Interrupted a SPI transfer - need to shut it down gracefully + for (uint8_t j = 1; j <= L64XX::chain[0]; j++) + L6470_buf[j] = dSPIN_NOP; // Fill buffer with NOOP commands + L64xx_MARLIN.transfer(L6470_buf, L64XX::chain[0]); // Send enough NOOPs to complete any command + L64xx_MARLIN.transfer(L6470_buf, L64XX::chain[0]); + L64xx_MARLIN.transfer(L6470_buf, L64XX::chain[0]); + } - //scan command array and copy matches into L6470.transfer - for (uint8_t j = 1; j <= L6470::chain[0]; j++) - L6470_buf[j] = L6470.dir_commands[L6470::chain[j]]; + // L64xx_MARLIN.dir_commands[] is an array that holds direction command for each stepper - L6470.transfer(L6470_buf, L6470::chain[0]); // send the command stream to the drivers + // Scan command array, copy matches into L64xx_MARLIN.transfer + for (uint8_t j = 1; j <= L64XX::chain[0]; j++) + L6470_buf[j] = L64xx_MARLIN.dir_commands[L64XX::chain[j]]; + L64xx_MARLIN.transfer(L6470_buf, L64XX::chain[0]); // send the command stream to the drivers + } #endif // A small delay may be needed after changing direction @@ -1798,22 +1796,26 @@ uint32_t Stepper::stepper_block_phase_isr() { else LA_isr_rate = LA_ADV_NEVER; #endif - if ( - #if HAS_DRIVER(L6470) - true // Always set direction for L6470 (This also enables the chips) - #else - current_block->direction_bits != last_direction_bits + #if !HAS_L64XX // always set direction if using L6470 driver(s) - this also enables the chips + if (current_block->direction_bits != last_direction_bits #if DISABLED(MIXING_EXTRUDER) || stepper_extruder != last_moved_extruder #endif + ) #endif - ) { - last_direction_bits = current_block->direction_bits; - #if EXTRUDERS > 1 - last_moved_extruder = stepper_extruder; - #endif - set_directions(); - } + { + + last_direction_bits = current_block->direction_bits; + #if EXTRUDERS > 1 + last_moved_extruder = stepper_extruder; + #endif + + #if HAS_L64XX + L64XX_OK_to_power_up = true; + #endif + + set_directions(); + } // At this point, we must ensure the movement about to execute isn't // trying to force the head against a limit switch. If using interrupt- diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper_indirection.cpp index 2e25b11afd6f..bd57cc52b6e8 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper_indirection.cpp @@ -37,8 +37,8 @@ #include "stepper.h" -#if HAS_DRIVER(L6470) - #include "L6470/L6470_Marlin.h" +#if HAS_L64XX + #include "../libs/L6470/L6470_Marlin.h" #endif // @@ -914,8 +914,8 @@ void reset_stepper_drivers() { tmc26x_init_to_defaults(); #endif - #if HAS_DRIVER(L6470) - L6470.init_to_defaults(); + #if HAS_L64XX + L64xx_MARLIN.init_to_defaults(); #endif #if HAS_TRINAMIC @@ -1022,117 +1022,133 @@ void reset_stepper_drivers() { // // L6470 Driver objects and inits // -#if HAS_DRIVER(L6470) +#if HAS_L64XX - // create stepper objects - - #define _L6470_DEFINE(ST) L6470 stepper##ST((const int)L6470_CHAIN_SS_PIN) - - // L6470 Stepper objects - #if AXIS_DRIVER_TYPE_X(L6470) - _L6470_DEFINE(X); + #if AXIS_IS_L64XX(X) + AXIS_CLASS_X stepperX(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_DEFINE(X2); + #if AXIS_IS_L64XX(X2) + AXIS_CLASS_X2 stepperX2(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_DEFINE(Y); + #if AXIS_IS_L64XX(Y) + AXIS_CLASS_Y stepperY(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_DEFINE(Y2); + #if AXIS_IS_L64XX(Y2) + AXIS_CLASS_Y2 stepperY2(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_DEFINE(Z); + #if AXIS_IS_L64XX(Z) + AXIS_CLASS_Z stepperZ(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_DEFINE(Z2); + #if AXIS_IS_L64XX(Z2) + AXIS_CLASS_Z2 stepperZ2(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_DEFINE(Z3); + #if AXIS_IS_L64XX(Z3) + AXIS_CLASS_Z3 stepperZ3(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_DEFINE(E0); + #if AXIS_IS_L64XX(E0) + AXIS_CLASS_E0 stepperE0(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_DEFINE(E1); + #if AXIS_IS_L64XX(E1) + AXIS_CLASS_E1 stepperE1(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_DEFINE(E2); + #if AXIS_IS_L64XX(E2) + AXIS_CLASS_E2 stepperE2(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_DEFINE(E3); + #if AXIS_IS_L64XX(E3) + AXIS_CLASS_E3 stepperE3(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_DEFINE(E4); + #if AXIS_IS_L64XX(E4) + AXIS_CLASS_E4 stepperE4(L6470_CHAIN_SS_PIN); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - _L6470_DEFINE(E5); + #if AXIS_IS_L64XX(E5) + AXIS_CLASS_E5 stepperE5(L6470_CHAIN_SS_PIN); #endif - // not using L6470 library's init command because it + // Not using L64XX class init method because it // briefly sends power to the steppers - #define _L6470_INIT_CHIP(Q) do{ \ - stepper##Q.resetDev(); \ - stepper##Q.softFree(); \ - stepper##Q.SetParam(L6470_CONFIG, CONFIG_PWM_DIV_1 \ - | CONFIG_PWM_MUL_2 \ - | CONFIG_SR_290V_us \ - | CONFIG_OC_SD_DISABLE \ - | CONFIG_VS_COMP_DISABLE \ - | CONFIG_SW_HARD_STOP \ - | CONFIG_INT_16MHZ); \ - stepper##Q.SetParam(L6470_KVAL_RUN, 0xFF); \ - stepper##Q.SetParam(L6470_KVAL_ACC, 0xFF); \ - stepper##Q.SetParam(L6470_KVAL_DEC, 0xFF); \ - stepper##Q.setMicroSteps(Q##_MICROSTEPS); \ - stepper##Q.setOverCurrent(Q##_OVERCURRENT); \ - stepper##Q.setStallCurrent(Q##_STALLCURRENT); \ - stepper##Q.SetParam(L6470_KVAL_HOLD, Q##_MAX_VOLTAGE); \ - stepper##Q.SetParam(L6470_ABS_POS, 0); \ - stepper##Q.getStatus(); \ - }while(0) + inline void L6470_init_chip(L64XX &st, const int ms, const int oc, const int sc, const int mv, const int slew_rate) { + st.set_handlers(L64xx_MARLIN.spi_init, L64xx_MARLIN.transfer_single, L64xx_MARLIN.transfer_chain); // specify which external SPI routines to use + st.resetDev(); + st.softFree(); + st.SetParam(st.L64XX_CONFIG, CONFIG_PWM_DIV_1 | CONFIG_PWM_MUL_2 | CONFIG_OC_SD_DISABLE | CONFIG_VS_COMP_DISABLE | CONFIG_SW_HARD_STOP | CONFIG_INT_16MHZ); + st.SetParam(L6470_KVAL_RUN, 0xFF); + st.SetParam(L6470_KVAL_ACC, 0xFF); + st.SetParam(L6470_KVAL_DEC, 0xFF); + st.setMicroSteps(ms); + st.setOverCurrent(oc); + st.setStallCurrent(sc); + st.SetParam(L6470_KVAL_HOLD, mv); + st.SetParam(L6470_ABS_POS, 0); + if (st.L6470_status_layout) { + uint32_t config_temp = st.GetParam(st.L64XX_CONFIG); + config_temp &= ~CONFIG_POW_SR; + switch (slew_rate) { + case 0: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_75V_us); break; + default: + case 1: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_110V_us); break; + case 3: + case 2: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_260V_us); break; + } + st.getStatus(); + st.getStatus(); + } + else { + st.SetParam(st.L64XX_CONFIG,(st.GetParam(st.L64XX_CONFIG) | PWR_VCC_7_5V)); + st.getStatus(); // must clear out status bits before can set slew rate + st.getStatus(); + switch (slew_rate) { + case 0: st.SetParam(L6470_GATECFG1, CONFIG1_SR_220V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_220V_us); break; + default: + case 1: st.SetParam(L6470_GATECFG1, CONFIG1_SR_400V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_400V_us); break; + case 2: st.SetParam(L6470_GATECFG1, CONFIG1_SR_520V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_520V_us); break; + case 3: st.SetParam(L6470_GATECFG1, CONFIG1_SR_980V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_980V_us); break; + } + } + } + + #define L6470_INIT_CHIP(Q) L6470_init_chip(stepper##Q, Q##_MICROSTEPS, Q##_OVERCURRENT, Q##_STALLCURRENT, Q##_MAX_VOLTAGE, Q##_SLEW_RATE) - void L6470_Marlin::init_to_defaults() { - #if AXIS_DRIVER_TYPE_X(L6470) - _L6470_INIT_CHIP(X); + void L64XX_Marlin::init_to_defaults() { + #if AXIS_IS_L64XX(X) + L6470_INIT_CHIP(X); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_INIT_CHIP(X2); + #if AXIS_IS_L64XX(X2) + L6470_INIT_CHIP(X2); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_INIT_CHIP(Y); + #if AXIS_IS_L64XX(Y) + L6470_INIT_CHIP(Y); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_INIT_CHIP(Y2); + #if AXIS_IS_L64XX(Y2) + L6470_INIT_CHIP(Y2); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_INIT_CHIP(Z); + #if AXIS_IS_L64XX(Z) + L6470_INIT_CHIP(Z); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_INIT_CHIP(Z2); + #if AXIS_IS_L64XX(Z2) + L6470_INIT_CHIP(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_INIT_CHIP(Z3); + #if AXIS_IS_L64XX(Z3) + L6470_INIT_CHIP(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_INIT_CHIP(E0); + #if AXIS_IS_L64XX(E0) + L6470_INIT_CHIP(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_INIT_CHIP(E1); + #if AXIS_IS_L64XX(E1) + L6470_INIT_CHIP(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_INIT_CHIP(E2); + #if AXIS_IS_L64XX(E2) + L6470_INIT_CHIP(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_INIT_CHIP(E3); + #if AXIS_IS_L64XX(E3) + L6470_INIT_CHIP(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_INIT_CHIP(E4); + #if AXIS_IS_L64XX(E4) + L6470_INIT_CHIP(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - _L6470_INIT_CHIP(E5); + #if AXIS_IS_L64XX(E5) + L6470_INIT_CHIP(E5); #endif } -#endif // L6470 +#endif // HAS_L64XX diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h index 147a060fc971..ff426bca3d4f 100644 --- a/Marlin/src/module/stepper_indirection.h +++ b/Marlin/src/module/stepper_indirection.h @@ -82,17 +82,22 @@ #endif // L6470 has STEP on normal pins, but DIR/ENABLE via SPI -#if HAS_DRIVER(L6470) - #include "L6470/L6470_Marlin.h" - #define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L6470_dir_commands[Q] = (STATE ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0) +#if HAS_L64XX + #include "../libs/L6470/L6470_Marlin.h" + #define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L64xx_MARLIN.dir_commands[Q] = (STATE ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0) #endif void restore_stepper_drivers(); // Called by PSU_ON void reset_stepper_drivers(); // Called by settings.load / settings.reset +class no_class { }; + +extern AXIS_CLASS_X stepperX; +extern AXIS_CLASS_Y stepperY; +extern AXIS_CLASS_Z stepperZ; + // X Stepper -#if AXIS_DRIVER_TYPE_X(L6470) - extern L6470 stepperX; +#if AXIS_IS_L64XX(X) #define X_ENABLE_INIT NOOP #define X_ENABLE_WRITE(STATE) NOOP #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ) @@ -100,11 +105,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define X_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X) #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR) #else - #if AXIS_IS_TMC(X) - extern TMC_CLASS(X) stepperX; - #endif #if AXIS_DRIVER_TYPE_X(TMC26X) - extern TMC26XStepper stepperX; #define X_ENABLE_INIT NOOP #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) #define X_ENABLE_READ stepperX.isEnabled() @@ -126,8 +127,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define X_STEP_READ READ(X_STEP_PIN) // Y Stepper -#if AXIS_DRIVER_TYPE_Y(L6470) - extern L6470 stepperY; +#if AXIS_IS_L64XX(Y) #define Y_ENABLE_INIT NOOP #define Y_ENABLE_WRITE(STATE) NOOP #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ) @@ -135,11 +135,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Y_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y) #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR) #else - #if AXIS_IS_TMC(Y) - extern TMC_CLASS(Y) stepperY; - #endif #if AXIS_DRIVER_TYPE_Y(TMC26X) - extern TMC26XStepper stepperY; #define Y_ENABLE_INIT NOOP #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) #define Y_ENABLE_READ stepperY.isEnabled() @@ -161,8 +157,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Y_STEP_READ READ(Y_STEP_PIN) // Z Stepper -#if AXIS_DRIVER_TYPE_Z(L6470) - extern L6470 stepperZ; +#if AXIS_IS_L64XX(Z) #define Z_ENABLE_INIT NOOP #define Z_ENABLE_WRITE(STATE) NOOP #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ) @@ -170,11 +165,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Z_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z) #define Z_DIR_READ (stepperZ.getStatus() & STATUS_DIR) #else - #if AXIS_IS_TMC(Z) - extern TMC_CLASS(Z) stepperZ; - #endif #if AXIS_DRIVER_TYPE_Z(TMC26X) - extern TMC26XStepper stepperZ; #define Z_ENABLE_INIT NOOP #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) #define Z_ENABLE_READ stepperZ.isEnabled() @@ -197,8 +188,8 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // X2 Stepper #if HAS_X2_ENABLE - #if AXIS_DRIVER_TYPE_X2(L6470) - extern L6470 stepperX2; + extern AXIS_CLASS_X2 stepperX2; + #if AXIS_IS_L64XX(X2) #define X2_ENABLE_INIT NOOP #define X2_ENABLE_WRITE(STATE) NOOP #define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ) @@ -206,11 +197,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define X2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X2) #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) #else - #if AXIS_IS_TMC(X2) - extern TMC_CLASS(X2) stepperX2; - #endif #if AXIS_DRIVER_TYPE_X2(TMC26X) - extern TMC26XStepper stepperX2; #define X2_ENABLE_INIT NOOP #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) #define X2_ENABLE_READ stepperX2.isEnabled() @@ -234,8 +221,8 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // Y2 Stepper #if HAS_Y2_ENABLE - #if AXIS_DRIVER_TYPE_Y2(L6470) - extern L6470 stepperY2; + extern AXIS_CLASS_Y2 stepperY2; + #if AXIS_IS_L64XX(Y2) #define Y2_ENABLE_INIT NOOP #define Y2_ENABLE_WRITE(STATE) NOOP #define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ) @@ -243,11 +230,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Y2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y2) #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) #else - #if AXIS_IS_TMC(Y2) - extern TMC_CLASS(Y2) stepperY2; - #endif #if AXIS_DRIVER_TYPE_Y2(TMC26X) - extern TMC26XStepper stepperY2; #define Y2_ENABLE_INIT NOOP #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) #define Y2_ENABLE_READ stepperY2.isEnabled() @@ -273,8 +256,8 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // Z2 Stepper #if HAS_Z2_ENABLE - #if AXIS_DRIVER_TYPE_Z2(L6470) - extern L6470 stepperZ2; + extern AXIS_CLASS_Z2 stepperZ2; + #if AXIS_IS_L64XX(Z2) #define Z2_ENABLE_INIT NOOP #define Z2_ENABLE_WRITE(STATE) NOOP #define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ) @@ -282,11 +265,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Z2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z2) #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) #else - #if AXIS_IS_TMC(Z2) - extern TMC_CLASS(Z2) stepperZ2; - #endif #if AXIS_DRIVER_TYPE_Z2(TMC26X) - extern TMC26XStepper stepperZ2; #define Z2_ENABLE_INIT NOOP #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) #define Z2_ENABLE_READ stepperZ2.isEnabled() @@ -312,8 +291,8 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset // Z3 Stepper #if HAS_Z3_ENABLE - #if AXIS_DRIVER_TYPE_Z3(L6470) - extern L6470 stepperZ3; + extern AXIS_CLASS_Z3 stepperZ3; + #if AXIS_IS_L64XX(Z3) #define Z3_ENABLE_INIT NOOP #define Z3_ENABLE_WRITE(STATE) NOOP #define Z3_ENABLE_READ (stepperZ3.getStatus() & STATUS_HIZ) @@ -321,11 +300,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Z3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z3) #define Z3_DIR_READ (stepperZ3.getStatus() & STATUS_DIR) #else - #if AXIS_IS_TMC(Z3) - extern TMC_CLASS(Z3) stepperZ3; - #endif #if ENABLED(Z3_IS_TMC26X) - extern TMC26XStepper stepperZ3; #define Z3_ENABLE_INIT NOOP #define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE) #define Z3_ENABLE_READ stepperZ3.isEnabled() @@ -350,214 +325,202 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #endif // E0 Stepper -#if AXIS_DRIVER_TYPE_E0(L6470) - extern L6470 stepperE0; - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) NOOP - #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ) - #define E0_DIR_INIT NOOP - #define E0_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E0) - #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E0) - extern TMC_CLASS(E0) stepperE0; - #endif - #if AXIS_DRIVER_TYPE_E0(TMC26X) - extern TMC26XStepper stepperE0; - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) - #define E0_ENABLE_READ stepperE0.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0) +#if HAS_E0_ENABLE + extern AXIS_CLASS_E0 stepperE0; + #if AXIS_IS_L64XX(E0) #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E0_ENABLE_READ stepperE0.isEnabled() + #define E0_ENABLE_WRITE(STATE) NOOP + #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ) + #define E0_DIR_INIT NOOP + #define E0_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E0) + #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) #else - #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) - #define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE) - #define E0_ENABLE_READ READ(E0_ENABLE_PIN) + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) + #define E0_ENABLE_READ stepperE0.isEnabled() + #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0) + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E0_ENABLE_READ stepperE0.isEnabled() + #else + #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) + #define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE) + #define E0_ENABLE_READ READ(E0_ENABLE_PIN) + #endif + #define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN) + #define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE) + #define E0_DIR_READ READ(E0_DIR_PIN) #endif - #define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN) - #define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE) - #define E0_DIR_READ READ(E0_DIR_PIN) + #define E0_STEP_INIT SET_OUTPUT(E0_STEP_PIN) + #define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE) + #define E0_STEP_READ READ(E0_STEP_PIN) #endif -#define E0_STEP_INIT SET_OUTPUT(E0_STEP_PIN) -#define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE) -#define E0_STEP_READ READ(E0_STEP_PIN) // E1 Stepper -#if AXIS_DRIVER_TYPE_E1(L6470) - extern L6470 stepperE1; - #define E1_ENABLE_INIT NOOP - #define E1_ENABLE_WRITE(STATE) NOOP - #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ) - #define E1_DIR_INIT NOOP - #define E1_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E1) - #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E1) - extern TMC_CLASS(E1) stepperE1; - #endif - #if AXIS_DRIVER_TYPE_E1(TMC26X) - extern TMC26XStepper stepperE1; - #define E1_ENABLE_INIT NOOP - #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) - #define E1_ENABLE_READ stepperE1.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1) +#if HAS_E1_ENABLE + extern AXIS_CLASS_E1 stepperE1; + #if AXIS_IS_L64XX(E1) #define E1_ENABLE_INIT NOOP - #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E1_ENABLE_READ stepperE1.isEnabled() + #define E1_ENABLE_WRITE(STATE) NOOP + #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ) + #define E1_DIR_INIT NOOP + #define E1_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E1) + #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) #else - #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) - #define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE) - #define E1_ENABLE_READ READ(E1_ENABLE_PIN) + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) + #define E1_ENABLE_READ stepperE1.isEnabled() + #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1) + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E1_ENABLE_READ stepperE1.isEnabled() + #else + #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) + #define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE) + #define E1_ENABLE_READ READ(E1_ENABLE_PIN) + #endif + #define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN) + #define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE) + #define E1_DIR_READ READ(E1_DIR_PIN) #endif - #define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN) - #define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE) - #define E1_DIR_READ READ(E1_DIR_PIN) + #define E1_STEP_INIT SET_OUTPUT(E1_STEP_PIN) + #define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE) + #define E1_STEP_READ READ(E1_STEP_PIN) #endif -#define E1_STEP_INIT SET_OUTPUT(E1_STEP_PIN) -#define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE) -#define E1_STEP_READ READ(E1_STEP_PIN) // E2 Stepper -#if AXIS_DRIVER_TYPE_E2(L6470) - extern L6470 stepperE2; - #define E2_ENABLE_INIT NOOP - #define E2_ENABLE_WRITE(STATE) NOOP - #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ) - #define E2_DIR_INIT NOOP - #define E2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E2) - #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E2) - extern TMC_CLASS(E2) stepperE2; - #endif - #if AXIS_DRIVER_TYPE_E2(TMC26X) - extern TMC26XStepper stepperE2; - #define E2_ENABLE_INIT NOOP - #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) - #define E2_ENABLE_READ stepperE2.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2) +#if HAS_E2_ENABLE + extern AXIS_CLASS_E2 stepperE2; + #if AXIS_IS_L64XX(E2) #define E2_ENABLE_INIT NOOP - #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E2_ENABLE_READ stepperE2.isEnabled() + #define E2_ENABLE_WRITE(STATE) NOOP + #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ) + #define E2_DIR_INIT NOOP + #define E2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E2) + #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) #else - #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) - #define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE) - #define E2_ENABLE_READ READ(E2_ENABLE_PIN) + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) + #define E2_ENABLE_READ stepperE2.isEnabled() + #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2) + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E2_ENABLE_READ stepperE2.isEnabled() + #else + #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) + #define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE) + #define E2_ENABLE_READ READ(E2_ENABLE_PIN) + #endif + #define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN) + #define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE) + #define E2_DIR_READ READ(E2_DIR_PIN) #endif - #define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN) - #define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE) - #define E2_DIR_READ READ(E2_DIR_PIN) + #define E2_STEP_INIT SET_OUTPUT(E2_STEP_PIN) + #define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE) + #define E2_STEP_READ READ(E2_STEP_PIN) #endif -#define E2_STEP_INIT SET_OUTPUT(E2_STEP_PIN) -#define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE) -#define E2_STEP_READ READ(E2_STEP_PIN) // E3 Stepper -#if AXIS_DRIVER_TYPE_E3(L6470) - extern L6470 stepperE3; - #define E3_ENABLE_INIT NOOP - #define E3_ENABLE_WRITE(STATE) NOOP - #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ) - #define E3_DIR_INIT NOOP - #define E3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E3) - #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E3) - extern TMC_CLASS(E3) stepperE3; - #endif - #if AXIS_DRIVER_TYPE_E3(TMC26X) - extern TMC26XStepper stepperE3; - #define E3_ENABLE_INIT NOOP - #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) - #define E3_ENABLE_READ stepperE3.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3) +#if HAS_E3_ENABLE + extern AXIS_CLASS_E3 stepperE3; + #if AXIS_IS_L64XX(E3) #define E3_ENABLE_INIT NOOP - #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E3_ENABLE_READ stepperE3.isEnabled() + #define E3_ENABLE_WRITE(STATE) NOOP + #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ) + #define E3_DIR_INIT NOOP + #define E3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E3) + #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR) #else - #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) - #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE) - #define E3_ENABLE_READ READ(E3_ENABLE_PIN) + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) + #define E3_ENABLE_READ stepperE3.isEnabled() + #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3) + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E3_ENABLE_READ stepperE3.isEnabled() + #else + #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) + #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE) + #define E3_ENABLE_READ READ(E3_ENABLE_PIN) + #endif + #define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN) + #define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE) + #define E3_DIR_READ READ(E3_DIR_PIN) #endif - #define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN) - #define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE) - #define E3_DIR_READ READ(E3_DIR_PIN) + #define E3_STEP_INIT SET_OUTPUT(E3_STEP_PIN) + #define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE) + #define E3_STEP_READ READ(E3_STEP_PIN) #endif -#define E3_STEP_INIT SET_OUTPUT(E3_STEP_PIN) -#define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE) -#define E3_STEP_READ READ(E3_STEP_PIN) // E4 Stepper -#if AXIS_DRIVER_TYPE_E4(L6470) - extern L6470 stepperE4; - #define E4_ENABLE_INIT NOOP - #define E4_ENABLE_WRITE(STATE) NOOP - #define E4_ENABLE_READ (stepperE4.getStatus() & STATUS_HIZ) - #define E4_DIR_INIT NOOP - #define E4_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E4) - #define E4_DIR_READ (stepperE4.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E4) - extern TMC_CLASS(E4) stepperE4; - #endif - #if AXIS_DRIVER_TYPE_E4(TMC26X) - extern TMC26XStepper stepperE4; - #define E4_ENABLE_INIT NOOP - #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE) - #define E4_ENABLE_READ stepperE4.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4) +#if HAS_E4_ENABLE + extern AXIS_CLASS_E4 stepperE4; + #if AXIS_IS_L64XX(E4) #define E4_ENABLE_INIT NOOP - #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E4_ENABLE_READ stepperE4.isEnabled() + #define E4_ENABLE_WRITE(STATE) NOOP + #define E4_ENABLE_READ (stepperE4.getStatus() & STATUS_HIZ) + #define E4_DIR_INIT NOOP + #define E4_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E4) + #define E4_DIR_READ (stepperE4.getStatus() & STATUS_DIR) #else - #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN) - #define E4_ENABLE_WRITE(STATE) WRITE(E4_ENABLE_PIN,STATE) - #define E4_ENABLE_READ READ(E4_ENABLE_PIN) + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_ENABLE_INIT NOOP + #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE) + #define E4_ENABLE_READ stepperE4.isEnabled() + #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4) + #define E4_ENABLE_INIT NOOP + #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E4_ENABLE_READ stepperE4.isEnabled() + #else + #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN) + #define E4_ENABLE_WRITE(STATE) WRITE(E4_ENABLE_PIN,STATE) + #define E4_ENABLE_READ READ(E4_ENABLE_PIN) + #endif + #define E4_DIR_INIT SET_OUTPUT(E4_DIR_PIN) + #define E4_DIR_WRITE(STATE) WRITE(E4_DIR_PIN,STATE) + #define E4_DIR_READ READ(E4_DIR_PIN) #endif - #define E4_DIR_INIT SET_OUTPUT(E4_DIR_PIN) - #define E4_DIR_WRITE(STATE) WRITE(E4_DIR_PIN,STATE) - #define E4_DIR_READ READ(E4_DIR_PIN) + #define E4_STEP_INIT SET_OUTPUT(E4_STEP_PIN) + #define E4_STEP_WRITE(STATE) WRITE(E4_STEP_PIN,STATE) + #define E4_STEP_READ READ(E4_STEP_PIN) #endif -#define E4_STEP_INIT SET_OUTPUT(E4_STEP_PIN) -#define E4_STEP_WRITE(STATE) WRITE(E4_STEP_PIN,STATE) -#define E4_STEP_READ READ(E4_STEP_PIN) // E5 Stepper -#if AXIS_DRIVER_TYPE_E5(L6470) - extern L6470 stepperE5; - #define E5_ENABLE_INIT NOOP - #define E5_ENABLE_WRITE(STATE) NOOP - #define E5_ENABLE_READ (stepperE5.getStatus() & STATUS_HIZ) - #define E5_DIR_INIT NOOP - #define E5_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E5) - #define E5_DIR_READ (stepperE5.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E5) - extern TMC_CLASS(E5) stepperE5; - #endif - #if AXIS_DRIVER_TYPE_E5(TMC26X) - extern TMC26XStepper stepperE5; - #define E5_ENABLE_INIT NOOP - #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE) - #define E5_ENABLE_READ stepperE5.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5) +#if HAS_E5_ENABLE + extern AXIS_CLASS_E5 stepperE5; + #if AXIS_IS_L64XX(E5) #define E5_ENABLE_INIT NOOP - #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E5_ENABLE_READ stepperE5.isEnabled() + #define E5_ENABLE_WRITE(STATE) NOOP + #define E5_ENABLE_READ (stepperE5.getStatus() & STATUS_HIZ) + #define E5_DIR_INIT NOOP + #define E5_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E5) + #define E5_DIR_READ (stepperE5.getStatus() & STATUS_DIR) #else - #define E5_ENABLE_INIT SET_OUTPUT(E5_ENABLE_PIN) - #define E5_ENABLE_WRITE(STATE) WRITE(E5_ENABLE_PIN,STATE) - #define E5_ENABLE_READ READ(E5_ENABLE_PIN) + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_ENABLE_INIT NOOP + #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE) + #define E5_ENABLE_READ stepperE5.isEnabled() + #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5) + #define E5_ENABLE_INIT NOOP + #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E5_ENABLE_READ stepperE5.isEnabled() + #else + #define E5_ENABLE_INIT SET_OUTPUT(E5_ENABLE_PIN) + #define E5_ENABLE_WRITE(STATE) WRITE(E5_ENABLE_PIN,STATE) + #define E5_ENABLE_READ READ(E5_ENABLE_PIN) + #endif + #define E5_DIR_INIT SET_OUTPUT(E5_DIR_PIN) + #define E5_DIR_WRITE(STATE) WRITE(E5_DIR_PIN,STATE) + #define E5_DIR_READ READ(E5_DIR_PIN) #endif - #define E5_DIR_INIT SET_OUTPUT(E5_DIR_PIN) - #define E5_DIR_WRITE(STATE) WRITE(E5_DIR_PIN,STATE) - #define E5_DIR_READ READ(E5_DIR_PIN) + #define E5_STEP_INIT SET_OUTPUT(E5_STEP_PIN) + #define E5_STEP_WRITE(STATE) WRITE(E5_STEP_PIN,STATE) + #define E5_STEP_READ READ(E5_STEP_PIN) #endif -#define E5_STEP_INIT SET_OUTPUT(E5_STEP_PIN) -#define E5_STEP_WRITE(STATE) WRITE(E5_STEP_PIN,STATE) -#define E5_STEP_READ READ(E5_STEP_PIN) /** * Extruder indirection for the single E axis diff --git a/buildroot/share/tests/megaatmega2560-tests b/buildroot/share/tests/megaatmega2560-tests index e8bf1eef5580..962cdee6cb0e 100755 --- a/buildroot/share/tests/megaatmega2560-tests +++ b/buildroot/share/tests/megaatmega2560-tests @@ -57,6 +57,11 @@ opt_set TEMP_SENSOR_2 5 opt_set TEMP_SENSOR_3 20 opt_set TEMP_SENSOR_4 999 opt_set TEMP_SENSOR_BED 1 +opt_set X_DRIVER_TYPE L6480 +opt_add L6470_CHAIN_SCK_PIN SCK_PIN +opt_add L6470_CHAIN_MISO_PIN MISO_PIN +opt_add L6470_CHAIN_MOSI_PIN MOSI_PIN +opt_add L6470_CHAIN_SS_PIN SS_PIN opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT \ USB_FLASH_DRIVE_SUPPORT SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES LIGHTWEIGHT_UI \ diff --git a/config/default/Configuration.h b/config/default/Configuration.h index 690a64e590f0..81b31d199796 100644 --- a/config/default/Configuration.h +++ b/config/default/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/default/Configuration_adv.h b/config/default/Configuration_adv.h index 1feec138caf1..f722d931ee33 100644 --- a/config/default/Configuration_adv.h +++ b/config/default/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/3DFabXYZ/Migbot/Configuration.h b/config/examples/3DFabXYZ/Migbot/Configuration.h index 5538470e0434..dcc502c93f0a 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration.h @@ -628,12 +628,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h index eeb26ea69dd5..2567f9c6794c 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/AlephObjects/TAZ4/Configuration.h b/config/examples/AlephObjects/TAZ4/Configuration.h index 214fd098172b..e04cece39e71 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/config/examples/AlephObjects/TAZ4/Configuration.h @@ -643,12 +643,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 077c3fa19db5..dd6f938a4dff 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/AliExpress/CL-260/Configuration.h b/config/examples/AliExpress/CL-260/Configuration.h index aa7e241163df..0c6dcc6b9b73 100644 --- a/config/examples/AliExpress/CL-260/Configuration.h +++ b/config/examples/AliExpress/CL-260/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/AliExpress/UM2pExt/Configuration.h b/config/examples/AliExpress/UM2pExt/Configuration.h index 15333458e1c5..481e32c252d9 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration.h +++ b/config/examples/AliExpress/UM2pExt/Configuration.h @@ -634,12 +634,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/AliExpress/UM2pExt/Configuration_adv.h b/config/examples/AliExpress/UM2pExt/Configuration_adv.h index 11b2d16586c5..240ed7db2112 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration_adv.h +++ b/config/examples/AliExpress/UM2pExt/Configuration_adv.h @@ -1687,12 +1687,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1702,112 +1702,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1833,7 +1846,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Anet/A2/Configuration.h b/config/examples/Anet/A2/Configuration.h index aafc72227ddc..1b55a889b0ff 100644 --- a/config/examples/Anet/A2/Configuration.h +++ b/config/examples/Anet/A2/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Anet/A2/Configuration_adv.h b/config/examples/Anet/A2/Configuration_adv.h index efc2f5b06b8c..6378f637842b 100644 --- a/config/examples/Anet/A2/Configuration_adv.h +++ b/config/examples/Anet/A2/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Anet/A2plus/Configuration.h b/config/examples/Anet/A2plus/Configuration.h index 9dbea7cf33e6..b37c4b1cff56 100644 --- a/config/examples/Anet/A2plus/Configuration.h +++ b/config/examples/Anet/A2plus/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Anet/A2plus/Configuration_adv.h b/config/examples/Anet/A2plus/Configuration_adv.h index efc2f5b06b8c..6378f637842b 100644 --- a/config/examples/Anet/A2plus/Configuration_adv.h +++ b/config/examples/Anet/A2plus/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Anet/A6/Configuration.h b/config/examples/Anet/A6/Configuration.h index 55fa6b7efb73..4176b40ca2b2 100644 --- a/config/examples/Anet/A6/Configuration.h +++ b/config/examples/Anet/A6/Configuration.h @@ -643,12 +643,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Anet/A6/Configuration_adv.h b/config/examples/Anet/A6/Configuration_adv.h index 5d8f2f4b788e..34e44d278cbd 100644 --- a/config/examples/Anet/A6/Configuration_adv.h +++ b/config/examples/Anet/A6/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Anet/A8/Configuration.h b/config/examples/Anet/A8/Configuration.h index ab30e4da4869..324847036b4b 100644 --- a/config/examples/Anet/A8/Configuration.h +++ b/config/examples/Anet/A8/Configuration.h @@ -636,12 +636,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Anet/A8/Configuration_adv.h b/config/examples/Anet/A8/Configuration_adv.h index 30aad0f3e3e5..304f7ca2da04 100644 --- a/config/examples/Anet/A8/Configuration_adv.h +++ b/config/examples/Anet/A8/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/AnyCubic/i3/Configuration.h b/config/examples/AnyCubic/i3/Configuration.h index b065f25e020c..9feb6360e86d 100644 --- a/config/examples/AnyCubic/i3/Configuration.h +++ b/config/examples/AnyCubic/i3/Configuration.h @@ -633,12 +633,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/AnyCubic/i3/Configuration_adv.h b/config/examples/AnyCubic/i3/Configuration_adv.h index 32b1cb12d18a..38d623552ca5 100644 --- a/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/config/examples/AnyCubic/i3/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/ArmEd/Configuration.h b/config/examples/ArmEd/Configuration.h index b9c401a3c53f..6459ced07982 100644 --- a/config/examples/ArmEd/Configuration.h +++ b/config/examples/ArmEd/Configuration.h @@ -624,12 +624,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/ArmEd/Configuration_adv.h b/config/examples/ArmEd/Configuration_adv.h index 572da25bbbe2..87ff17eccee2 100644 --- a/config/examples/ArmEd/Configuration_adv.h +++ b/config/examples/ArmEd/Configuration_adv.h @@ -1689,12 +1689,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1704,112 +1704,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1835,7 +1848,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Azteeg/X5GT/Configuration.h b/config/examples/Azteeg/X5GT/Configuration.h index 0a2e702256e9..620e81576018 100644 --- a/config/examples/Azteeg/X5GT/Configuration.h +++ b/config/examples/Azteeg/X5GT/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/BIBO/TouchX/cyclops/Configuration.h b/config/examples/BIBO/TouchX/cyclops/Configuration.h index b00d02fd3e8d..0ccbd67ffaa7 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index 9b49bbc1dfd6..6006d12cdc5d 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/BIBO/TouchX/default/Configuration.h b/config/examples/BIBO/TouchX/default/Configuration.h index 21b31e9ed8c7..7a4ae2205fe7 100644 --- a/config/examples/BIBO/TouchX/default/Configuration.h +++ b/config/examples/BIBO/TouchX/default/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/BIBO/TouchX/default/Configuration_adv.h b/config/examples/BIBO/TouchX/default/Configuration_adv.h index d306fcaf393a..41fad9aea57f 100644 --- a/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/BQ/Hephestos/Configuration.h b/config/examples/BQ/Hephestos/Configuration.h index 350d5b3537c2..cb78d6684c38 100644 --- a/config/examples/BQ/Hephestos/Configuration.h +++ b/config/examples/BQ/Hephestos/Configuration.h @@ -611,12 +611,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/BQ/Hephestos/Configuration_adv.h b/config/examples/BQ/Hephestos/Configuration_adv.h index ea625f87f5df..004e77f50b4a 100644 --- a/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/config/examples/BQ/Hephestos/Configuration_adv.h @@ -1682,12 +1682,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1697,112 +1697,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1828,7 +1841,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/BQ/Hephestos_2/Configuration.h b/config/examples/BQ/Hephestos_2/Configuration.h index a2bc0dd3a396..8cebc001aaca 100644 --- a/config/examples/BQ/Hephestos_2/Configuration.h +++ b/config/examples/BQ/Hephestos_2/Configuration.h @@ -624,12 +624,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/BQ/Hephestos_2/Configuration_adv.h b/config/examples/BQ/Hephestos_2/Configuration_adv.h index fd4cf95b0bb6..1f86da79221c 100644 --- a/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -1690,12 +1690,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1705,112 +1705,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1836,7 +1849,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/BQ/WITBOX/Configuration.h b/config/examples/BQ/WITBOX/Configuration.h index db07f8396d2a..7dca50400103 100644 --- a/config/examples/BQ/WITBOX/Configuration.h +++ b/config/examples/BQ/WITBOX/Configuration.h @@ -611,12 +611,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/BQ/WITBOX/Configuration_adv.h b/config/examples/BQ/WITBOX/Configuration_adv.h index ea625f87f5df..004e77f50b4a 100644 --- a/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/config/examples/BQ/WITBOX/Configuration_adv.h @@ -1682,12 +1682,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1697,112 +1697,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1828,7 +1841,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Cartesio/Configuration.h b/config/examples/Cartesio/Configuration.h index 54cd602812c9..d7fa0c84b0c9 100644 --- a/config/examples/Cartesio/Configuration.h +++ b/config/examples/Cartesio/Configuration.h @@ -622,12 +622,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Cartesio/Configuration_adv.h b/config/examples/Cartesio/Configuration_adv.h index 76197adb5528..53bcf82c1cbf 100644 --- a/config/examples/Cartesio/Configuration_adv.h +++ b/config/examples/Cartesio/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/CR-10/Configuration.h b/config/examples/Creality/CR-10/Configuration.h index 0c84bd67c4f1..7a8e80b4655f 100644 --- a/config/examples/Creality/CR-10/Configuration.h +++ b/config/examples/Creality/CR-10/Configuration.h @@ -633,12 +633,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Creality/CR-10/Configuration_adv.h b/config/examples/Creality/CR-10/Configuration_adv.h index f2654ef31b97..772d45d20113 100644 --- a/config/examples/Creality/CR-10/Configuration_adv.h +++ b/config/examples/Creality/CR-10/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/CR-10S/Configuration.h b/config/examples/Creality/CR-10S/Configuration.h index 277bc926e711..62b6ae8caa7e 100644 --- a/config/examples/Creality/CR-10S/Configuration.h +++ b/config/examples/Creality/CR-10S/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Creality/CR-10S/Configuration_adv.h b/config/examples/Creality/CR-10S/Configuration_adv.h index ede6c7598b80..ad82a98487ab 100644 --- a/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/CR-10_5S/Configuration.h b/config/examples/Creality/CR-10_5S/Configuration.h index a09c9fb18139..cbb4cf0bc5f8 100644 --- a/config/examples/Creality/CR-10_5S/Configuration.h +++ b/config/examples/Creality/CR-10_5S/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Creality/CR-10_5S/Configuration_adv.h b/config/examples/Creality/CR-10_5S/Configuration_adv.h index 6ae9a5c81d1c..64ab95a6ebc3 100644 --- a/config/examples/Creality/CR-10_5S/Configuration_adv.h +++ b/config/examples/Creality/CR-10_5S/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/CR-10mini/Configuration.h b/config/examples/Creality/CR-10mini/Configuration.h index 95816cc3bbb4..321e16cf2b28 100644 --- a/config/examples/Creality/CR-10mini/Configuration.h +++ b/config/examples/Creality/CR-10mini/Configuration.h @@ -642,12 +642,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Creality/CR-10mini/Configuration_adv.h b/config/examples/Creality/CR-10mini/Configuration_adv.h index 34914463cade..06a2e9bdf352 100644 --- a/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/CR-8/Configuration.h b/config/examples/Creality/CR-8/Configuration.h index ed60bdaf9f76..294efffb24a2 100644 --- a/config/examples/Creality/CR-8/Configuration.h +++ b/config/examples/Creality/CR-8/Configuration.h @@ -633,12 +633,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Creality/CR-8/Configuration_adv.h b/config/examples/Creality/CR-8/Configuration_adv.h index b23aa8ba9ab9..14463df04ff0 100644 --- a/config/examples/Creality/CR-8/Configuration_adv.h +++ b/config/examples/Creality/CR-8/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/Ender-2/Configuration.h b/config/examples/Creality/Ender-2/Configuration.h index 649d38b5304b..e10cce6dba55 100644 --- a/config/examples/Creality/Ender-2/Configuration.h +++ b/config/examples/Creality/Ender-2/Configuration.h @@ -627,12 +627,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Creality/Ender-2/Configuration_adv.h b/config/examples/Creality/Ender-2/Configuration_adv.h index efffbdfefe8a..fc59bb247c6f 100644 --- a/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/config/examples/Creality/Ender-2/Configuration_adv.h @@ -1682,12 +1682,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1697,112 +1697,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1828,7 +1841,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/Ender-3/Configuration.h b/config/examples/Creality/Ender-3/Configuration.h index 2dfb44514b7c..751ae781780e 100644 --- a/config/examples/Creality/Ender-3/Configuration.h +++ b/config/examples/Creality/Ender-3/Configuration.h @@ -627,12 +627,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Creality/Ender-3/Configuration_adv.h b/config/examples/Creality/Ender-3/Configuration_adv.h index ac7936a38654..6ffeefa7c3c1 100644 --- a/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/Configuration_adv.h @@ -1682,12 +1682,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1697,112 +1697,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1828,7 +1841,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/Ender-4/Configuration.h b/config/examples/Creality/Ender-4/Configuration.h index cdad37df893b..6b24107db0b7 100644 --- a/config/examples/Creality/Ender-4/Configuration.h +++ b/config/examples/Creality/Ender-4/Configuration.h @@ -633,12 +633,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Creality/Ender-4/Configuration_adv.h b/config/examples/Creality/Ender-4/Configuration_adv.h index 374490d5d323..c86d4ea5584e 100644 --- a/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/config/examples/Creality/Ender-4/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Einstart-S/Configuration.h b/config/examples/Einstart-S/Configuration.h index 0efc7d1ed3dd..b1b203845dfd 100644 --- a/config/examples/Einstart-S/Configuration.h +++ b/config/examples/Einstart-S/Configuration.h @@ -635,12 +635,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Einstart-S/Configuration_adv.h b/config/examples/Einstart-S/Configuration_adv.h index 4aa6523e8c7e..76eb0de02504 100644 --- a/config/examples/Einstart-S/Configuration_adv.h +++ b/config/examples/Einstart-S/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Felix/Configuration.h b/config/examples/Felix/Configuration.h index 10caeab72688..a07e39b2cfa2 100644 --- a/config/examples/Felix/Configuration.h +++ b/config/examples/Felix/Configuration.h @@ -604,12 +604,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Felix/Configuration_adv.h b/config/examples/Felix/Configuration_adv.h index 1c636d6147ab..d434cd4797e7 100644 --- a/config/examples/Felix/Configuration_adv.h +++ b/config/examples/Felix/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Felix/DUAL/Configuration.h b/config/examples/Felix/DUAL/Configuration.h index 8d04683ed4c1..bf3107e72f9a 100644 --- a/config/examples/Felix/DUAL/Configuration.h +++ b/config/examples/Felix/DUAL/Configuration.h @@ -604,12 +604,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/FlashForge/CreatorPro/Configuration.h b/config/examples/FlashForge/CreatorPro/Configuration.h index db76df88986d..b2c1e3b4391f 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration.h +++ b/config/examples/FlashForge/CreatorPro/Configuration.h @@ -613,12 +613,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/FlashForge/CreatorPro/Configuration_adv.h b/config/examples/FlashForge/CreatorPro/Configuration_adv.h index e31c0e33820f..f1662866bc55 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -1681,12 +1681,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1696,112 +1696,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1827,7 +1840,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/FolgerTech/i3-2020/Configuration.h b/config/examples/FolgerTech/i3-2020/Configuration.h index cde0f88efe20..5ed1826176c4 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration.h +++ b/config/examples/FolgerTech/i3-2020/Configuration.h @@ -628,12 +628,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/config/examples/FolgerTech/i3-2020/Configuration_adv.h index b8cd9fc6e568..46356a55ed8f 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Formbot/Raptor/Configuration.h b/config/examples/Formbot/Raptor/Configuration.h index e9a720e8ca88..9cd2e6c2689e 100644 --- a/config/examples/Formbot/Raptor/Configuration.h +++ b/config/examples/Formbot/Raptor/Configuration.h @@ -675,12 +675,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Formbot/Raptor/Configuration_adv.h b/config/examples/Formbot/Raptor/Configuration_adv.h index c043b278d721..d62f0a389de0 100644 --- a/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/config/examples/Formbot/Raptor/Configuration_adv.h @@ -1687,12 +1687,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1702,112 +1702,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1833,7 +1846,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Formbot/T_Rex_2+/Configuration.h b/config/examples/Formbot/T_Rex_2+/Configuration.h index 7baba596f28b..54ad3893bb76 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration.h @@ -652,12 +652,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h index 0f304432d38c..93aa4ca86845 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -1689,12 +1689,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1704,112 +1704,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1835,7 +1848,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Formbot/T_Rex_3/Configuration.h b/config/examples/Formbot/T_Rex_3/Configuration.h index 55ef696fb7ee..ddee6788f61a 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration.h +++ b/config/examples/Formbot/T_Rex_3/Configuration.h @@ -632,12 +632,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Formbot/T_Rex_3/Configuration_adv.h b/config/examples/Formbot/T_Rex_3/Configuration_adv.h index c613c021fca2..7ff7707ab1de 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -1689,12 +1689,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1704,112 +1704,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1835,7 +1848,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/A10M/Configuration.h b/config/examples/Geeetech/A10M/Configuration.h index 68f6b195c38f..d44d7979a120 100644 --- a/config/examples/Geeetech/A10M/Configuration.h +++ b/config/examples/Geeetech/A10M/Configuration.h @@ -606,12 +606,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Geeetech/A10M/Configuration_adv.h b/config/examples/Geeetech/A10M/Configuration_adv.h index fb44f31a378c..6a29b749b128 100644 --- a/config/examples/Geeetech/A10M/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/A20M/Configuration.h b/config/examples/Geeetech/A20M/Configuration.h index 9fe4501f6a6f..b0a40debea7d 100644 --- a/config/examples/Geeetech/A20M/Configuration.h +++ b/config/examples/Geeetech/A20M/Configuration.h @@ -606,12 +606,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Geeetech/A20M/Configuration_adv.h b/config/examples/Geeetech/A20M/Configuration_adv.h index 5d968ca30c57..4db374d63ecc 100644 --- a/config/examples/Geeetech/A20M/Configuration_adv.h +++ b/config/examples/Geeetech/A20M/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/GT2560/Configuration.h b/config/examples/Geeetech/GT2560/Configuration.h index e639b11b35b3..415672405585 100644 --- a/config/examples/Geeetech/GT2560/Configuration.h +++ b/config/examples/Geeetech/GT2560/Configuration.h @@ -638,12 +638,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h b/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h index 526cbc7e67f5..9d5b43f6ee94 100644 --- a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Geeetech/MeCreator2/Configuration.h b/config/examples/Geeetech/MeCreator2/Configuration.h index c6a762292006..6a6eda6e6ef5 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration.h +++ b/config/examples/Geeetech/MeCreator2/Configuration.h @@ -630,12 +630,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/config/examples/Geeetech/MeCreator2/Configuration_adv.h index 3249965da387..4cd920ecc4d8 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h index 714cfb164a8c..965af8c0c1c0 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -638,12 +638,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h index 1c8ed790f25b..5a7c30868a31 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -638,12 +638,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h index 8994c16df258..7b25e1db90a7 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index 69b7400ef1bc..b53e430e043a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h index 459de6b2423b..d659365a988c 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index 69b7400ef1bc..b53e430e043a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Infitary/i3-M508/Configuration.h b/config/examples/Infitary/i3-M508/Configuration.h index 992f8ecd1aad..7bba89a4b8da 100644 --- a/config/examples/Infitary/i3-M508/Configuration.h +++ b/config/examples/Infitary/i3-M508/Configuration.h @@ -627,12 +627,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Infitary/i3-M508/Configuration_adv.h b/config/examples/Infitary/i3-M508/Configuration_adv.h index 7ec6e6e9843a..9a5eade47b25 100644 --- a/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/JGAurora/A5/Configuration.h b/config/examples/JGAurora/A5/Configuration.h index 328f5a827c91..09109a389681 100644 --- a/config/examples/JGAurora/A5/Configuration.h +++ b/config/examples/JGAurora/A5/Configuration.h @@ -635,12 +635,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/JGAurora/A5/Configuration_adv.h b/config/examples/JGAurora/A5/Configuration_adv.h index f94812a27a0d..ec9d8d10a451 100644 --- a/config/examples/JGAurora/A5/Configuration_adv.h +++ b/config/examples/JGAurora/A5/Configuration_adv.h @@ -1682,12 +1682,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1697,112 +1697,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1828,7 +1841,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/MakerParts/Configuration.h b/config/examples/MakerParts/Configuration.h index fa9f5213a644..b47f93a16b1c 100644 --- a/config/examples/MakerParts/Configuration.h +++ b/config/examples/MakerParts/Configuration.h @@ -643,12 +643,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/MakerParts/Configuration_adv.h b/config/examples/MakerParts/Configuration_adv.h index a94d5bb73d3d..3edaabde8303 100644 --- a/config/examples/MakerParts/Configuration_adv.h +++ b/config/examples/MakerParts/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Malyan/M150/Configuration.h b/config/examples/Malyan/M150/Configuration.h index bc922c01c948..a411e3880798 100644 --- a/config/examples/Malyan/M150/Configuration.h +++ b/config/examples/Malyan/M150/Configuration.h @@ -632,12 +632,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Malyan/M150/Configuration_adv.h b/config/examples/Malyan/M150/Configuration_adv.h index 3ecac682f81f..401d7ab23c35 100644 --- a/config/examples/Malyan/M150/Configuration_adv.h +++ b/config/examples/Malyan/M150/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Malyan/M200/Configuration.h b/config/examples/Malyan/M200/Configuration.h index 249eef8560e7..e87701c7d905 100644 --- a/config/examples/Malyan/M200/Configuration.h +++ b/config/examples/Malyan/M200/Configuration.h @@ -622,12 +622,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Malyan/M200/Configuration_adv.h b/config/examples/Malyan/M200/Configuration_adv.h index 93e06f45b8df..867a1fc2346c 100644 --- a/config/examples/Malyan/M200/Configuration_adv.h +++ b/config/examples/Malyan/M200/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Micromake/C1/basic/Configuration.h b/config/examples/Micromake/C1/basic/Configuration.h index d69bd893fcf0..fb197c2de355 100644 --- a/config/examples/Micromake/C1/basic/Configuration.h +++ b/config/examples/Micromake/C1/basic/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Micromake/C1/enhanced/Configuration.h b/config/examples/Micromake/C1/enhanced/Configuration.h index dc43a3f7b9ae..d93314c169b1 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/config/examples/Micromake/C1/enhanced/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/config/examples/Micromake/C1/enhanced/Configuration_adv.h index 1feec138caf1..f722d931ee33 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Mks/Robin/Configuration.h b/config/examples/Mks/Robin/Configuration.h index 10cf219015af..233d00affaaf 100644 --- a/config/examples/Mks/Robin/Configuration.h +++ b/config/examples/Mks/Robin/Configuration.h @@ -624,12 +624,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Mks/Robin/Configuration_adv.h b/config/examples/Mks/Robin/Configuration_adv.h index 38307a0aaf85..9eefe6c42a6a 100644 --- a/config/examples/Mks/Robin/Configuration_adv.h +++ b/config/examples/Mks/Robin/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Mks/Sbase/Configuration.h b/config/examples/Mks/Sbase/Configuration.h index 26e72a5be10b..20631edbb211 100644 --- a/config/examples/Mks/Sbase/Configuration.h +++ b/config/examples/Mks/Sbase/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE DRV8825 #define Y_DRIVER_TYPE DRV8825 diff --git a/config/examples/Mks/Sbase/Configuration_adv.h b/config/examples/Mks/Sbase/Configuration_adv.h index f2f10f39ffd3..98466a37c50f 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -1686,12 +1686,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1701,112 +1701,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1832,7 +1845,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Printrbot/PrintrboardG2/Configuration.h b/config/examples/Printrbot/PrintrboardG2/Configuration.h index ee9508f56d2b..a2aba1ebbff8 100644 --- a/config/examples/Printrbot/PrintrboardG2/Configuration.h +++ b/config/examples/Printrbot/PrintrboardG2/Configuration.h @@ -624,12 +624,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE DRV8825 //#define Y_DRIVER_TYPE DRV8825 diff --git a/config/examples/RapideLite/RL200/Configuration.h b/config/examples/RapideLite/RL200/Configuration.h index 672a68fbfb30..7d0b20351e8e 100644 --- a/config/examples/RapideLite/RL200/Configuration.h +++ b/config/examples/RapideLite/RL200/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE DRV8825 #define Y_DRIVER_TYPE DRV8825 diff --git a/config/examples/RapideLite/RL200/Configuration_adv.h b/config/examples/RapideLite/RL200/Configuration_adv.h index 6627677397ac..dcea784b6d95 100644 --- a/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/config/examples/RapideLite/RL200/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/RepRapPro/Huxley/Configuration.h b/config/examples/RepRapPro/Huxley/Configuration.h index 0be5d4c5d3b9..ae63c4557b3f 100644 --- a/config/examples/RepRapPro/Huxley/Configuration.h +++ b/config/examples/RepRapPro/Huxley/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/RepRapWorld/Megatronics/Configuration.h b/config/examples/RepRapWorld/Megatronics/Configuration.h index e6bcfb658daa..928701628616 100644 --- a/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/config/examples/RepRapWorld/Megatronics/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/RigidBot/Configuration.h b/config/examples/RigidBot/Configuration.h index 5efecfe46bbb..f28ba598e128 100644 --- a/config/examples/RigidBot/Configuration.h +++ b/config/examples/RigidBot/Configuration.h @@ -619,12 +619,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/RigidBot/Configuration_adv.h b/config/examples/RigidBot/Configuration_adv.h index b11cbc3dc2f5..86fbf86cfb3c 100644 --- a/config/examples/RigidBot/Configuration_adv.h +++ b/config/examples/RigidBot/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/SCARA/Configuration.h b/config/examples/SCARA/Configuration.h index d1b9df7439b2..4da7c7f74c15 100644 --- a/config/examples/SCARA/Configuration.h +++ b/config/examples/SCARA/Configuration.h @@ -636,12 +636,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/SCARA/Configuration_adv.h b/config/examples/SCARA/Configuration_adv.h index 5a42a0de7bf7..fd8bbb59777c 100644 --- a/config/examples/SCARA/Configuration_adv.h +++ b/config/examples/SCARA/Configuration_adv.h @@ -1682,12 +1682,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1697,112 +1697,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1828,7 +1841,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/STM32F10/Configuration.h b/config/examples/STM32F10/Configuration.h index ed8be3a3a57c..ad5e0a8cec03 100644 --- a/config/examples/STM32F10/Configuration.h +++ b/config/examples/STM32F10/Configuration.h @@ -625,12 +625,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/STM32F4/Configuration.h b/config/examples/STM32F4/Configuration.h index b2b3df4dee6e..bc8edcd79fb4 100644 --- a/config/examples/STM32F4/Configuration.h +++ b/config/examples/STM32F4/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Sanguinololu/Configuration.h b/config/examples/Sanguinololu/Configuration.h index d8221a72bb73..79a6415681e1 100644 --- a/config/examples/Sanguinololu/Configuration.h +++ b/config/examples/Sanguinololu/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Sanguinololu/Configuration_adv.h b/config/examples/Sanguinololu/Configuration_adv.h index 1c5faa8b133d..84c3e4a340cd 100644 --- a/config/examples/Sanguinololu/Configuration_adv.h +++ b/config/examples/Sanguinololu/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/TheBorg/Configuration.h b/config/examples/TheBorg/Configuration.h index 18e8f8ecc1ea..d944893f2972 100644 --- a/config/examples/TheBorg/Configuration.h +++ b/config/examples/TheBorg/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/TheBorg/Configuration_adv.h b/config/examples/TheBorg/Configuration_adv.h index 5ca3dd7f9e1c..d492d3735a36 100644 --- a/config/examples/TheBorg/Configuration_adv.h +++ b/config/examples/TheBorg/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/TinyBoy2/Configuration.h b/config/examples/TinyBoy2/Configuration.h index a580f5fe93bf..efeed85b45eb 100644 --- a/config/examples/TinyBoy2/Configuration.h +++ b/config/examples/TinyBoy2/Configuration.h @@ -674,12 +674,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/TinyBoy2/Configuration_adv.h b/config/examples/TinyBoy2/Configuration_adv.h index fc53ef8d349a..4b0e0295b1f7 100644 --- a/config/examples/TinyBoy2/Configuration_adv.h +++ b/config/examples/TinyBoy2/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Tronxy/X1/Configuration.h b/config/examples/Tronxy/X1/Configuration.h index 8a008fc03e57..d0b0bdc3840d 100644 --- a/config/examples/Tronxy/X1/Configuration.h +++ b/config/examples/Tronxy/X1/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Tronxy/X3A/Configuration.h b/config/examples/Tronxy/X3A/Configuration.h index 52fb6d7984ea..8a7966aa5c8c 100644 --- a/config/examples/Tronxy/X3A/Configuration.h +++ b/config/examples/Tronxy/X3A/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Tronxy/X3A/Configuration_adv.h b/config/examples/Tronxy/X3A/Configuration_adv.h index 8fa8952f60d8..55e4b4f54343 100644 --- a/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/config/examples/Tronxy/X3A/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Tronxy/X5S-2E/Configuration.h b/config/examples/Tronxy/X5S-2E/Configuration.h index b12befd0fb99..5acfce3950dc 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration.h +++ b/config/examples/Tronxy/X5S-2E/Configuration.h @@ -642,12 +642,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ // Tronxy X5S-2E: // The OEM stock model uses HEROIC HR4982MTE982 stepper drivers which are similar to A4988 except that they only have 2 step divider pins instead of three. diff --git a/config/examples/Tronxy/X5S-2E/Configuration_adv.h b/config/examples/Tronxy/X5S-2E/Configuration_adv.h index a8ba1a8ff343..70c88aff5a3e 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Tronxy/X5S/Configuration.h b/config/examples/Tronxy/X5S/Configuration.h index 445eb09bce5f..d0d345452ba9 100644 --- a/config/examples/Tronxy/X5S/Configuration.h +++ b/config/examples/Tronxy/X5S/Configuration.h @@ -622,12 +622,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Tronxy/XY100/Configuration.h b/config/examples/Tronxy/XY100/Configuration.h index cf33edcc5a1d..f30f3c56231a 100644 --- a/config/examples/Tronxy/XY100/Configuration.h +++ b/config/examples/Tronxy/XY100/Configuration.h @@ -634,12 +634,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/UltiMachine/Archim1/Configuration.h b/config/examples/UltiMachine/Archim1/Configuration.h index 1e750bdcda90..4ec92a84223c 100644 --- a/config/examples/UltiMachine/Archim1/Configuration.h +++ b/config/examples/UltiMachine/Archim1/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE DRV8825 #define Y_DRIVER_TYPE DRV8825 diff --git a/config/examples/UltiMachine/Archim1/Configuration_adv.h b/config/examples/UltiMachine/Archim1/Configuration_adv.h index 562f1c30da06..92656c6b1fe6 100644 --- a/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/UltiMachine/Archim2/Configuration.h b/config/examples/UltiMachine/Archim2/Configuration.h index 01da81b965cb..560139f4b857 100644 --- a/config/examples/UltiMachine/Archim2/Configuration.h +++ b/config/examples/UltiMachine/Archim2/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC2130 #define Y_DRIVER_TYPE TMC2130 diff --git a/config/examples/UltiMachine/Archim2/Configuration_adv.h b/config/examples/UltiMachine/Archim2/Configuration_adv.h index 467de2e8185d..4a2305aebef2 100644 --- a/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/VORONDesign/Configuration.h b/config/examples/VORONDesign/Configuration.h index 9df9d786de06..cf33554630a4 100644 --- a/config/examples/VORONDesign/Configuration.h +++ b/config/examples/VORONDesign/Configuration.h @@ -632,12 +632,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE DRV8825 #define Y_DRIVER_TYPE DRV8825 diff --git a/config/examples/VORONDesign/Configuration_adv.h b/config/examples/VORONDesign/Configuration_adv.h index f30536359ac5..8ccaecdb790a 100644 --- a/config/examples/VORONDesign/Configuration_adv.h +++ b/config/examples/VORONDesign/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Velleman/K8200/Configuration.h b/config/examples/Velleman/K8200/Configuration.h index ecd2166fdcda..79588aa3ce60 100644 --- a/config/examples/Velleman/K8200/Configuration.h +++ b/config/examples/Velleman/K8200/Configuration.h @@ -653,12 +653,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Velleman/K8200/Configuration_adv.h b/config/examples/Velleman/K8200/Configuration_adv.h index 682a99dfa027..825e45be9d44 100644 --- a/config/examples/Velleman/K8200/Configuration_adv.h +++ b/config/examples/Velleman/K8200/Configuration_adv.h @@ -1698,12 +1698,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1713,112 +1713,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1844,7 +1857,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Velleman/K8400/Configuration.h b/config/examples/Velleman/K8400/Configuration.h index e3ae7ddc4cda..a926826d255b 100644 --- a/config/examples/Velleman/K8400/Configuration.h +++ b/config/examples/Velleman/K8400/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Velleman/K8400/Configuration_adv.h b/config/examples/Velleman/K8400/Configuration_adv.h index 3b66bde755e0..fd247aa41ba7 100644 --- a/config/examples/Velleman/K8400/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Velleman/K8400/Dual-head/Configuration.h b/config/examples/Velleman/K8400/Dual-head/Configuration.h index 507cf49fb54f..b73b2fadbba8 100644 --- a/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/config/examples/Velleman/K8400/Dual-head/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/WASP/PowerWASP/Configuration.h b/config/examples/WASP/PowerWASP/Configuration.h index 0fd8fea4bec7..fd913b44c6fc 100644 --- a/config/examples/WASP/PowerWASP/Configuration.h +++ b/config/examples/WASP/PowerWASP/Configuration.h @@ -642,12 +642,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/WASP/PowerWASP/Configuration_adv.h b/config/examples/WASP/PowerWASP/Configuration_adv.h index 5beac0b76886..43e4018688e5 100644 --- a/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Wanhao/Duplicator 6/Configuration.h b/config/examples/Wanhao/Duplicator 6/Configuration.h index 36740548ec25..822b3c462866 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration.h @@ -633,12 +633,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 503edbd50256..faccaf5067d1 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/adafruit/ST7565/Configuration.h b/config/examples/adafruit/ST7565/Configuration.h index b5659bca710d..a5d572816879 100644 --- a/config/examples/adafruit/ST7565/Configuration.h +++ b/config/examples/adafruit/ST7565/Configuration.h @@ -623,12 +623,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/Anycubic/Kossel/Configuration.h b/config/examples/delta/Anycubic/Kossel/Configuration.h index 132b9b2ec24c..1cb7710165d1 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration.h @@ -744,12 +744,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h index 89eeced8f4f1..0882b95f82d0 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h index 60b428aa1a7e..db4458ed8c73 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -696,12 +696,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index b9dc2faebf26..2ed09c0baa8b 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/FLSUN/kossel/Configuration.h b/config/examples/delta/FLSUN/kossel/Configuration.h index f0ad8e96865c..c4319b0cbe73 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/config/examples/delta/FLSUN/kossel/Configuration.h @@ -696,12 +696,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/config/examples/delta/FLSUN/kossel/Configuration_adv.h index b9dc2faebf26..2ed09c0baa8b 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration.h b/config/examples/delta/FLSUN/kossel_mini/Configuration.h index a81433be4e7d..c24630c114a1 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -696,12 +696,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index 6ec96b262a47..911e95824f72 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration.h b/config/examples/delta/Geeetech/Rostock 301/Configuration.h index c0d022fc65dd..7dbc1e8acb6a 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration.h @@ -686,12 +686,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h index 6ec96b262a47..911e95824f72 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/Hatchbox_Alpha/Configuration.h b/config/examples/delta/Hatchbox_Alpha/Configuration.h index 72f229b85c37..0862490ff24f 100644 --- a/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -701,12 +701,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/MKS/SBASE/Configuration.h b/config/examples/delta/MKS/SBASE/Configuration.h index 04f4188cfefb..b52681e55c80 100644 --- a/config/examples/delta/MKS/SBASE/Configuration.h +++ b/config/examples/delta/MKS/SBASE/Configuration.h @@ -686,12 +686,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/MKS/SBASE/Configuration_adv.h b/config/examples/delta/MKS/SBASE/Configuration_adv.h index 459e9a585a2e..72ab4cb8d5c6 100644 --- a/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/Tevo Little Monster/Configuration.h b/config/examples/delta/Tevo Little Monster/Configuration.h index 4e59729aa4cf..8366fcd64b29 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration.h +++ b/config/examples/delta/Tevo Little Monster/Configuration.h @@ -690,12 +690,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/Tevo Little Monster/Configuration_adv.h b/config/examples/delta/Tevo Little Monster/Configuration_adv.h index 5435f50a5af9..d1422a3b6028 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/generic/Configuration.h b/config/examples/delta/generic/Configuration.h index e92df5925b76..8ad3b0624322 100644 --- a/config/examples/delta/generic/Configuration.h +++ b/config/examples/delta/generic/Configuration.h @@ -686,12 +686,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/generic/Configuration_adv.h b/config/examples/delta/generic/Configuration_adv.h index 6ec96b262a47..911e95824f72 100644 --- a/config/examples/delta/generic/Configuration_adv.h +++ b/config/examples/delta/generic/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/kossel_mini/Configuration.h b/config/examples/delta/kossel_mini/Configuration.h index 344ca37773fe..e7e94c138697 100644 --- a/config/examples/delta/kossel_mini/Configuration.h +++ b/config/examples/delta/kossel_mini/Configuration.h @@ -686,12 +686,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/kossel_mini/Configuration_adv.h b/config/examples/delta/kossel_mini/Configuration_adv.h index 58e29e24828b..63cdd6d3831f 100644 --- a/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/kossel_mini/Configuration_adv.h @@ -1683,12 +1683,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1698,112 +1698,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1829,7 +1842,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/kossel_pro/Configuration.h b/config/examples/delta/kossel_pro/Configuration.h index be880cebbb9d..1e3d5ace22ee 100644 --- a/config/examples/delta/kossel_pro/Configuration.h +++ b/config/examples/delta/kossel_pro/Configuration.h @@ -672,12 +672,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/kossel_xl/Configuration.h b/config/examples/delta/kossel_xl/Configuration.h index 60a7fb32b5f0..1b975ac9146c 100644 --- a/config/examples/delta/kossel_xl/Configuration.h +++ b/config/examples/delta/kossel_xl/Configuration.h @@ -690,12 +690,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/delta/kossel_xl/Configuration_adv.h b/config/examples/delta/kossel_xl/Configuration_adv.h index 9ed05be63078..7d512317fc82 100644 --- a/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/config/examples/delta/kossel_xl/Configuration_adv.h @@ -1684,12 +1684,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1699,112 +1699,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1830,7 +1843,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/gCreate/gMax1.5+/Configuration.h b/config/examples/gCreate/gMax1.5+/Configuration.h index 5cc6ecda2fe4..b0caac315579 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/config/examples/gCreate/gMax1.5+/Configuration.h @@ -636,12 +636,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/config/examples/gCreate/gMax1.5+/Configuration_adv.h index de829f0c40e2..98ae6f6404c5 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/makibox/Configuration.h b/config/examples/makibox/Configuration.h index 972270351e26..46ae7e6ba4dd 100644 --- a/config/examples/makibox/Configuration.h +++ b/config/examples/makibox/Configuration.h @@ -626,12 +626,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/makibox/Configuration_adv.h b/config/examples/makibox/Configuration_adv.h index 57b17fe292aa..98f25fc51124 100644 --- a/config/examples/makibox/Configuration_adv.h +++ b/config/examples/makibox/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/stm32f103ret6/Configuration.h b/config/examples/stm32f103ret6/Configuration.h index 398891d9e1e0..fb3512a53f88 100644 --- a/config/examples/stm32f103ret6/Configuration.h +++ b/config/examples/stm32f103ret6/Configuration.h @@ -625,12 +625,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/tvrrug/Round2/Configuration.h b/config/examples/tvrrug/Round2/Configuration.h index b190924fa6e9..b9b78944d1bd 100644 --- a/config/examples/tvrrug/Round2/Configuration.h +++ b/config/examples/tvrrug/Round2/Configuration.h @@ -612,12 +612,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/tvrrug/Round2/Configuration_adv.h b/config/examples/tvrrug/Round2/Configuration_adv.h index 83511ea730a8..ad674ae4937d 100644 --- a/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/config/examples/tvrrug/Round2/Configuration_adv.h @@ -1685,12 +1685,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1700,112 +1700,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1831,7 +1844,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/wt150/Configuration.h b/config/examples/wt150/Configuration.h index 249d19e24af3..8642f9ac0040 100644 --- a/config/examples/wt150/Configuration.h +++ b/config/examples/wt150/Configuration.h @@ -628,12 +628,11 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE, - * TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600, + * TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208, + * TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/wt150/Configuration_adv.h b/config/examples/wt150/Configuration_adv.h index 509bbf18ba50..0b093e57b49e 100644 --- a/config/examples/wt150/Configuration_adv.h +++ b/config/examples/wt150/Configuration_adv.h @@ -1686,12 +1686,12 @@ #endif // HAS_TRINAMIC -// @section L6470 +// @section L64XX /** - * L6470 Stepper Driver options + * L64XX Stepper Driver options * - * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * Arduino-L6470 library (0.7.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -1701,112 +1701,125 @@ * L6470_CHAIN_SS_PIN * L6470_RESET_CHAIN_PIN (optional) */ -#if HAS_DRIVER(L6470) +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #endif - - #if AXIS_DRIVER_TYPE_X2(L6470) - #define X2_MICROSTEPS 128 - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y(L6470) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Y2(L6470) - #define Y2_MICROSTEPS 128 - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z(L6470) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z2(L6470) - #define Z2_MICROSTEPS 128 - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_Z3(L6470) - #define Z3_MICROSTEPS 128 - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E0(L6470) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E1(L6470) - #define E1_MICROSTEPS 128 - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E2(L6470) - #define E2_MICROSTEPS 128 - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E3(L6470) - #define E3_MICROSTEPS 128 - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E4(L6470) - #define E4_MICROSTEPS 128 - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 - #endif - - #if AXIS_DRIVER_TYPE_E5(L6470) - #define E5_MICROSTEPS 128 - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest + #endif + + #if AXIS_IS_L64XX(X2) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Y2) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z2) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(Z3) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E0) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E1) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E2) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E3) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E4) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E5) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -1832,7 +1845,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS