From ef80a517c8d4c52643dee592d2c6022d613b1233 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 8 Mar 2019 20:14:18 -0600 Subject: [PATCH 01/23] Fix SERIAL_ECHOLNPAIR Fix #13333 --- Marlin/src/core/serial.h | 54 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index c1d323bca587..66b5308c9918 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -106,33 +106,33 @@ extern uint8_t marlin_debug_flags; #define SERIAL_ECHOPAIR(...) _SEP_N(NUM_ARGS(__VA_ARGS__),__VA_ARGS__) // Print up to 12 pairs of values followed by newline -#define __SELP_N(N,...) _SELP_##N(__VA_ARGS__) -#define _SELP_N(N,...) __SELP_N(N,__VA_ARGS__) -#define _SELP_2(PRE,V) do{ serial_echopair_PGM(PSTR(PRE),V); SERIAL_EOL(); }while(0) -#define _SELP_3(PRE,V,ETC) do{ serial_echopair_PGM(PSTR(PRE),V); SERIAL_ECHOLNPGM(ETC); }while(0) -#define _SELP_4(a,b,...) do{ _SELP_2(a,b); _SELP_2(__VA_ARGS__); }while(0) -#define _SELP_5(a,b,...) do{ _SELP_2(a,b); _SELP_3(__VA_ARGS__); }while(0) -#define _SELP_6(a,b,...) do{ _SELP_2(a,b); _SELP_4(__VA_ARGS__); }while(0) -#define _SELP_7(a,b,...) do{ _SELP_2(a,b); _SELP_5(__VA_ARGS__); }while(0) -#define _SELP_8(a,b,...) do{ _SELP_2(a,b); _SELP_6(__VA_ARGS__); }while(0) -#define _SELP_9(a,b,...) do{ _SELP_2(a,b); _SELP_7(__VA_ARGS__); }while(0) -#define _SELP_10(a,b,...) do{ _SELP_2(a,b); _SELP_8(__VA_ARGS__); }while(0) -#define _SELP_11(a,b,...) do{ _SELP_2(a,b); _SELP_9(__VA_ARGS__); }while(0) -#define _SELP_12(a,b,...) do{ _SELP_2(a,b); _SELP_10(__VA_ARGS__); }while(0) -#define _SELP_13(a,b,...) do{ _SELP_2(a,b); _SELP_11(__VA_ARGS__); }while(0) -#define _SELP_14(a,b,...) do{ _SELP_2(a,b); _SELP_12(__VA_ARGS__); }while(0) -#define _SELP_15(a,b,...) do{ _SELP_2(a,b); _SELP_13(__VA_ARGS__); }while(0) -#define _SELP_16(a,b,...) do{ _SELP_2(a,b); _SELP_14(__VA_ARGS__); }while(0) -#define _SELP_17(a,b,...) do{ _SELP_2(a,b); _SELP_15(__VA_ARGS__); }while(0) -#define _SELP_18(a,b,...) do{ _SELP_2(a,b); _SELP_16(__VA_ARGS__); }while(0) -#define _SELP_19(a,b,...) do{ _SELP_2(a,b); _SELP_17(__VA_ARGS__); }while(0) -#define _SELP_20(a,b,...) do{ _SELP_2(a,b); _SELP_18(__VA_ARGS__); }while(0) -#define _SELP_21(a,b,...) do{ _SELP_2(a,b); _SELP_19(__VA_ARGS__); }while(0) -#define _SELP_22(a,b,...) do{ _SELP_2(a,b); _SELP_20(__VA_ARGS__); }while(0) -#define _SELP_23(a,b,...) do{ _SELP_2(a,b); _SELP_21(__VA_ARGS__); }while(0) -#define _SELP_24(a,b,...) do{ _SELP_2(a,b); _SELP_22(__VA_ARGS__); }while(0) - -#define SERIAL_ECHOLNPAIR(...) _SELP_N(NUM_ARGS(__VA_ARGS__),__VA_ARGS__) +#define __SELP_N(N,...) _SELP_##N(__VA_ARGS__) +#define _SELP_N(N,...) __SELP_N(N,__VA_ARGS__) +#define _SELP_2(PRE,V) serial_echopair_PGM(PSTR(PRE),V) +#define _SELP_3(a,b,c) do{ _SELP_2(a,b); SERIAL_ECHOPGM(c); }while(0) +#define _SELP_4(a,b,...) do{ _SELP_2(a,b); _SELP_2(__VA_ARGS__); }while(0) +#define _SELP_5(a,b,...) do{ _SELP_2(a,b); _SELP_3(__VA_ARGS__); }while(0) +#define _SELP_6(a,b,...) do{ _SELP_2(a,b); _SELP_4(__VA_ARGS__); }while(0) +#define _SELP_7(a,b,...) do{ _SELP_2(a,b); _SELP_5(__VA_ARGS__); }while(0) +#define _SELP_8(a,b,...) do{ _SELP_2(a,b); _SELP_6(__VA_ARGS__); }while(0) +#define _SELP_9(a,b,...) do{ _SELP_2(a,b); _SELP_7(__VA_ARGS__); }while(0) +#define _SELP_10(a,b,...) do{ _SELP_2(a,b); _SELP_8(__VA_ARGS__); }while(0) +#define _SELP_11(a,b,...) do{ _SELP_2(a,b); _SELP_9(__VA_ARGS__); }while(0) +#define _SELP_12(a,b,...) do{ _SELP_2(a,b); _SELP_10(__VA_ARGS__); }while(0) +#define _SELP_13(a,b,...) do{ _SELP_2(a,b); _SELP_11(__VA_ARGS__); }while(0) +#define _SELP_14(a,b,...) do{ _SELP_2(a,b); _SELP_12(__VA_ARGS__); }while(0) +#define _SELP_15(a,b,...) do{ _SELP_2(a,b); _SELP_13(__VA_ARGS__); }while(0) +#define _SELP_16(a,b,...) do{ _SELP_2(a,b); _SELP_14(__VA_ARGS__); }while(0) +#define _SELP_17(a,b,...) do{ _SELP_2(a,b); _SELP_15(__VA_ARGS__); }while(0) +#define _SELP_18(a,b,...) do{ _SELP_2(a,b); _SELP_16(__VA_ARGS__); }while(0) +#define _SELP_19(a,b,...) do{ _SELP_2(a,b); _SELP_17(__VA_ARGS__); }while(0) +#define _SELP_20(a,b,...) do{ _SELP_2(a,b); _SELP_18(__VA_ARGS__); }while(0) +#define _SELP_21(a,b,...) do{ _SELP_2(a,b); _SELP_19(__VA_ARGS__); }while(0) +#define _SELP_22(a,b,...) do{ _SELP_2(a,b); _SELP_20(__VA_ARGS__); }while(0) +#define _SELP_23(a,b,...) do{ _SELP_2(a,b); _SELP_21(__VA_ARGS__); }while(0) +#define _SELP_24(a,b,...) do{ _SELP_2(a,b); _SELP_22(__VA_ARGS__); }while(0) + +#define SERIAL_ECHOLNPAIR(...) do{ _SELP_N(NUM_ARGS(__VA_ARGS__),__VA_ARGS__); SERIAL_EOL(); }while(0) #define SERIAL_ECHOPGM(S) (serialprintPGM(PSTR(S))) #define SERIAL_ECHOLNPGM(S) (serialprintPGM(PSTR(S "\n"))) From 5f3240c6a3da94a79264f929edf559f766508f0e Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Thu, 24 Jan 2019 22:55:45 -0600 Subject: [PATCH 02/23] Support powerSTEP01, L6480 (L64XX v0.7.0) --- Marlin/Configuration.h | 11 +- Marlin/Configuration_adv.h | 217 ++++---- Marlin/src/HAL/HAL_LINUX/include/serial.h | 2 + Marlin/src/HAL/shared/HAL_spi_L6470.cpp | 80 +-- Marlin/src/Marlin.cpp | 8 +- Marlin/src/Marlin.h | 47 +- Marlin/src/core/drivers.h | 190 +++++++ Marlin/src/core/enum.h | 4 - Marlin/src/gcode/calibrate/G28.cpp | 17 +- Marlin/src/gcode/feature/L6470/M122.cpp | 138 ++++-- Marlin/src/gcode/feature/L6470/M906.cpp | 134 ++--- Marlin/src/gcode/feature/L6470/M916-918.cpp | 158 +++--- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/host/M114.cpp | 54 +- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/libs/L6470/L6470_Marlin.cpp | 519 +++++++++++--------- Marlin/src/libs/L6470/L6470_Marlin.h | 81 ++- Marlin/src/module/stepper.cpp | 74 +-- Marlin/src/module/stepper_indirection.cpp | 181 +++---- Marlin/src/module/stepper_indirection.h | 401 +++++++-------- buildroot/share/tests/megaatmega2560-tests | 5 + config/default/Configuration.h | 11 +- config/default/Configuration_adv.h | 217 ++++---- platformio.ini | 2 +- 25 files changed, 1454 insertions(+), 1103 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f31d4481b540..820e540e0c80 100644 --- a/Marlin/Configuration.h +++ b/Marlin/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/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 9ce2193c85d8..7035ca065e86 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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..df6c02f1579b 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. + * L64XXHelper methods for SPI init and transfer */ +void L6470_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 L6470_Marlin::transfer(uint8_t data, int16_t ss_pin) { // first device in chain has data sent last extDigitalWrite(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); return data_out; } -void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) { +uint8_t L6470_Marlin::transfer(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) && !L64helper.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 L6470_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 d6b6b534d7c5..61d25056d38c 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -168,7 +168,7 @@ #include "lcd/extensible_ui/ui_api.h" #endif -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "libs/L6470/L6470_Marlin.h" #endif @@ -635,7 +635,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - L6470.monitor_driver(); + L64helper.monitor_driver(); #endif // Limit check_axes_activity frequency to 10Hz @@ -816,8 +816,8 @@ void setup() { HAL_init(); #endif - #if HAS_DRIVER(L6470) - L6470.init(); // setup SPI and then init chips + #if HAS_L64XX + L64helper.init(); // setup SPI and init chips #endif #if ENABLED(MAX7219_DEBUG) diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index bea5c358c950..0b6c65875aa4 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 25fe2245f6e5..abb72127ce0b 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 @@ -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 fc5b5fedb7b1..75ba6d177edd 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -45,7 +45,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 @@ -455,11 +455,18 @@ void GcodeSuite::G28(const bool always_home_all) { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G28"); #endif - #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]; + L64helper.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..2b1d5ac30153 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,86 +30,138 @@ 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); +#if 0 + +void L6470_status_decode(const uint16_t status, const L6470_axis_t axis) { + if (Marlin_L6470.spi_abort) return; // don't do anything if set_directions() has occurred + if (L64helper.spi_abort) return; // don't do anything if set_directions() has occurred + L64helper.say_axis(axis); #if ENABLED(L6470_CHITCHAT) char temp_buf[20]; sprintf_P(temp_buf, PSTR(" status: %4x "), status); SERIAL_ECHO(temp_buf); print_bin(status); #endif + const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; SERIAL_ECHOPGM("\n...OUTPUT: "); serialprintPGM(status & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); SERIAL_ECHOPGM(" BUSY: "); echo_yes_no(!(status & STATUS_BUSY)); SERIAL_ECHOPGM(" DIR: "); - serialprintPGM((((status & STATUS_DIR) >> 4) ^ L6470.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); + serialprintPGM((((status & STATUS_DIR) >> 4) ^ L64helper.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); SERIAL_ECHOPGM(" Last Command: "); - if (status & STATUS_WRONG_CMD) SERIAL_ECHOPGM("IN"); + if (status & 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(status & sh.STATUS_AXIS_NOTPERF_CMD ? PSTR("Not PERFORMED") : PSTR("COMPLETED ")); + SERIAL_ECHOPAIR("\n...THERMAL: ", !(status & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(status & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK "); + } + else switch ((status & (sh.STATUS_AXIS_TH_SD | sh.STATUS_AXIS_TH_WRN)) >> 11) { + case 0: SERIAL_ECHOPGM("\n...THERMAL: DEVICE SHUTDOWN"); break; // these bits were inverted to make them active low + case 1: SERIAL_ECHOPGM("\n...THERMAL: BRIDGE SHUTDOWN"); break; + case 2: SERIAL_ECHOPGM("\n...THERMAL: WARNING "); break; + case 3: SERIAL_ECHOPGM("\n...THERMAL: OK "); break; + } + SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no(!(status & sh.STATUS_AXIS_OCD)); + SERIAL_ECHOPGM(" STALL:"); echo_yes_no(!(status & sh.STATUS_AXIS_STEP_LOSS_A) || !(status & sh.STATUS_AXIS_STEP_LOSS_B)); + SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no(status & sh.STATUS_AXIS_SCK_MOD); SERIAL_EOL(); } +#define L6470_STATUS_DECODE(Q) L6470_status_decode(stepper##Q.getStatus(), Q) + +#endif + +inline void L6470_say_status(const L6470_axis_t axis) { + if (L64helper.spi_abort) return; + const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + L64helper.get_status(axis); + L64helper.say_axis(axis); + #if ENABLED(L6470_CHITCHAT) + char temp_buf[20]; + sprintf_P(temp_buf, PSTR(" status: %4x "), sh.STATUS_AXIS_RAW); + SERIAL_ECHO(temp_buf); + print_bin(sh.STATUS_AXIS_RAW); + serialprintPGM(sh.STATUS_AXIS_LAYOUT ? PSTR(" L6470") : PSTR(" L6480/powerSTEP01")); + #endif + SERIAL_ECHOPGM("\n...OUTPUT: "); + 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((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64helper.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); + SERIAL_ECHOPGM(" Last Command: "); + if (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("IN"); + SERIAL_ECHOPGM("VALID "); + 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_ECHOLNPGM(" STEP-CLOCK MODE:"); echo_yes_no(sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD); +} + /** * M122: Debug L6470 drivers */ 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) + L64helper.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; + L64helper.spi_active = false; // done with all SPI transfers - clear handshake flags + L64helper.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 f13b205cb6c9..2faaf3d8b395 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" @@ -79,42 +79,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 (L64helper.spi_abort) return; // don't do anything if set_directions() has occurred + const uint16_t status = L64helper.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 L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + L64helper.say_axis(axis); #if ENABLED(L6470_CHITCHAT) - 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); + 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)); @@ -129,6 +129,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)) { + 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() { @@ -138,7 +158,7 @@ void GcodeSuite::M906() { bool report_current = true; - #if HAS_DRIVER(L6470) + #if HAS_L64XX const uint8_t index = parser.byteval('I'); #endif @@ -153,29 +173,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; @@ -183,22 +203,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 } @@ -209,51 +229,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 + L64helper.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; + L64helper.spi_active = false; // done with all SPI transfers - clear handshake flags + L64helper.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 1ec60363a727..1605f0577e90 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" @@ -61,23 +61,23 @@ void GcodeSuite::M916() { L6470_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 L64helper.get_user_input function - some may not be used + char *axis_mon[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 (L64helper.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 L6470_ECHOLNPAIR("feedrate = ", final_feedrate); @@ -85,12 +85,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 + L64helper.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 L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; L6470_ECHOLNPGM(".\n."); @@ -99,7 +100,7 @@ void GcodeSuite::M916() { L6470_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); + L64helper.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); @@ -114,31 +115,31 @@ 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] = (~L64helper.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)) { L6470_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } 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) L6470_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))) { L6470_ECHOLNPGM("has occurred"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } } else @@ -178,29 +179,29 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("M917"); - char axis_mon[3][3] = { " ", " ", " " }; // list of axes to be monitored - uint8_t axis_index[3]; + char *axis_mon[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 (L64helper.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 L6470_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 + L64helper.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]; @@ -211,16 +212,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 - L6470_ECHOPAIR(".\n.\n.\nover_current threshold : ", (ocd_th_val + 1) * 375); // first status display - L6470_ECHOPAIR(" (OCD_TH: : ", ocd_th_val); - L6470_ECHOPAIR(") Stall threshold: ", (stall_th_val + 1) * 31.25); - L6470_ECHOPAIR(" (STALL_TH: ", stall_th_val); + L6470_ECHOPAIR(".\n.\n.\nover_current threshold : ", (OCD_TH_val + 1) * 375); // first status display + L6470_ECHOPAIR(" (OCD_TH: : ", OCD_TH_val); + L6470_ECHOPAIR(") Stall threshold: ", (STALL_TH_val + 1) * 31.25); + L6470_ECHOPAIR(" (STALL_TH: ", STALL_TH_val); L6470_ECHOLNPGM(")"); + const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + do { - L6470_ECHOPAIR("STALL threshold : ", (stall_th_val + 1) * 31.25); - L6470_ECHOLNPAIR(" OCD threshold : ", (ocd_th_val + 1) * 375); + L6470_ECHOPAIR("STALL threshold : ", (STALL_TH_val + 1) * 31.25); + L6470_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); @@ -233,20 +236,20 @@ 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] = (~L64helper.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)) { L6470_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } return; } - if (status_composite & (STATUS_TH_WRN | STATUS_TH_SD)) { + if (status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) { L6470_ECHOLNPGM("thermal problem - waiting for chip(s) to cool down "); uint16_t status_composite_temp = 0; uint8_t k = 0; @@ -257,7 +260,7 @@ void GcodeSuite::M917() { L6470_EOL(); L6470_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); + L64helper.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); } L6470_ECHOLNPGM("."); gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered @@ -265,33 +268,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] = (~L64helper.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)); + while (status_composite_temp & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)); L6470_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 L6470_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 L6470_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 L6470_ECHOLNPGM("LOGIC E0C - dec OCD"); } else { @@ -302,15 +305,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 L6470_ECHOLNPGM("LOGIC E1A - OCD at max - go to 2"); } else { - ocd_th_val++; // try a higher value + OCD_TH_val++; // try a higher value L6470_ECHOLNPGM("LOGIC E1B - inc OCD"); } } @@ -321,23 +324,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 >= sh.AXIS_STALL_TH_MAX) { + STALL_TH_val = sh.AXIS_STALL_TH_MAX; // limit to max L6470_ECHOLNPGM("LOGIC E2A - STALL warning, STALL at max, quit"); L6470_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 L6470_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 L6470_ECHOLNPGM("LOGIC E2C - no STALL, dec STALL"); } else { @@ -349,16 +352,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 >= sh.AXIS_STALL_TH_MAX) { + STALL_TH_val = sh.AXIS_STALL_TH_MAX; // limit to max L6470_ECHOLNPGM("finished - STALL at maximum value but still have stall warning"); test_phase = 4; L6470_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 L6470_ECHOLNPGM("LOGIC E3B - STALL, inc stall"); } } @@ -375,8 +378,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 L6470_ECHOLNPGM("LOGIC N0A - DEC OCD"); } else { @@ -388,8 +391,8 @@ void GcodeSuite::M917() { case 1: L6470_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) L6470_ECHOLNPGM("LOGIC N2B - dec STALL"); } else { @@ -407,10 +410,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) L6470_ECHOLNPGM("OCD mismatch"); - if (L6470.get_param(axis_index[j], L6470_STALL_TH) != stall_th_val) L6470_ECHOLNPGM("STALL mismatch"); + L64helper.set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val); + L64helper.set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val); + if (L64helper.get_param(axis_index[j], L6470_OCD_TH) != OCD_TH_val) L6470_ECHOLNPGM("OCD mismatch"); + if (L64helper.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) L6470_ECHOLNPGM("STALL mismatch"); } } @@ -420,7 +423,7 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("Completed with errors"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } } else @@ -450,21 +453,21 @@ void GcodeSuite::M918() { L6470_ECHOLNPGM("M918"); - char axis_mon[3][3] = { " ", " ", " " }; // List of axes to monitor - uint8_t axis_index[3]; + char *axis_mon[3] = { " ", " ", " " }; // List of axes to monitor + 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; 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 (L64helper.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'); @@ -490,7 +493,7 @@ void GcodeSuite::M918() { } for (j = 0; j < driver_count; j++) - L6470.set_param(axis_index[j], L6470_STEP_MODE, m_bits); // set microsteps + L64helper.set_param(axis_index[j], L6470_STEP_MODE, m_bits); // set microsteps L6470_ECHOLNPAIR("target (maximum) feedrate = ",final_feedrate); @@ -500,11 +503,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 + L64helper.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; @@ -523,7 +526,7 @@ 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] = (~L64helper.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 @@ -533,12 +536,11 @@ void GcodeSuite::M918() { L6470_ECHOLNPGM("Completed with errors"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } } else L6470_ECHOLNPGM("Completed with 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 2c9232f1ba57..5a668137a8f6 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -697,7 +697,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 61786ceceeb8..8efb5db93423 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 ffb5f56de739..4883e2b2b9da 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" #endif void report_xyze(const float pos[], const uint8_t n = 4, const uint8_t precision = 3) { @@ -85,61 +83,61 @@ 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); \ - 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); \ - L6470_ECHO(temp_buf); \ - }while(0) - - L6470_ECHOPGM("\nL6470:"); - #if AXIS_DRIVER_TYPE_X(L6470) + #define REPORT_ABSOLUTE_POS(Q) do{ \ + L64helper.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); \ + L6470_ECHO(temp_buf); \ + }while(0) + + L6470_ECHOPGM("\nL64XX:"); + #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 f644b3a7d063..f713e07ba2d6 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1683,7 +1683,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 (ENABLED(G29_RETRY_AND_RECOVER) || ENABLED(GCODE_MACROS) || ENABLED(POWER_LOSS_RECOVERY) || HAS_DRIVER(L6470)) +#define USE_EXECUTE_COMMANDS_IMMEDIATE (ENABLED(G29_RETRY_AND_RECOVER) || ENABLED(GCODE_MACROS) || ENABLED(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 927063564b55..f886bf263ac9 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -26,261 +26,284 @@ #include "../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "L6470_Marlin.h" -L6470_Marlin L6470; +extern L6470_Marlin L64helper; -#include "../stepper_indirection.h" +#include "../../module/stepper_indirection.h" #include "../../gcode/gcode.h" -#include "../planner.h" +#include "../../module/planner.h" + +const char * const L6470_Marlin::index_to_axis[MAX_L6470] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; uint8_t L6470_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" }; - -bool L6470_Marlin::index_to_dir[MAX_L6470] = { - INVERT_X_DIR , // 0 X - INVERT_Y_DIR , // 1 Y - INVERT_Z_DIR , // 2 Z - #if ENABLED(X_DUAL_STEPPER_DRIVERS) - INVERT_X_DIR ^ INVERT_X2_VS_X_DIR , // 3 X2 - #else - INVERT_X_DIR , // 3 X2 - #endif - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - INVERT_Y_DIR ^ INVERT_Y2_VS_Y_DIR , // 4 Y2 - #else - INVERT_Y_DIR , // 4 Y2 - #endif - INVERT_Z_DIR , // 5 Z2 - INVERT_Z_DIR , // 6 Z3 - INVERT_E0_DIR , // 7 E0 - INVERT_E1_DIR , // 8 E1 - INVERT_E2_DIR , // 9 E2 - INVERT_E3_DIR , //10 E3 - INVERT_E4_DIR , //11 E4 - INVERT_E5_DIR , //12 E5 -}; - -uint8_t L6470_Marlin::axis_xref[MAX_L6470] = { - AxisEnum(X_AXIS), // X - AxisEnum(Y_AXIS), // Y - AxisEnum(Z_AXIS), // Z - AxisEnum(X_AXIS), // X2 - AxisEnum(Y_AXIS), // Y2 - AxisEnum(Z_AXIS), // Z2 - AxisEnum(Z_AXIS), // Z3 - AxisEnum(E_AXIS), // E0 - AxisEnum(E_AXIS), // E1 - AxisEnum(E_AXIS), // E2 - AxisEnum(E_AXIS), // E3 - AxisEnum(E_AXIS), // E4 - AxisEnum(E_AXIS) // E5 -}; +bool L6470_Marlin::index_to_dir[MAX_L6470] = { INVERT_X_DIR , // 0 X + INVERT_Y_DIR , // 1 Y + INVERT_Z_DIR , // 2 Z + #if ENABLED(X_DUAL_STEPPER_DRIVERS) + INVERT_X_DIR ^ INVERT_X2_VS_X_DIR , // 3 X2 + #else + INVERT_X_DIR , // 3 X2 + #endif + #if ENABLED(Y_DUAL_STEPPER_DRIVERS) + INVERT_Y_DIR ^ INVERT_Y2_VS_Y_DIR , // 4 Y2 + #else + INVERT_Y_DIR , // 4 Y2 + #endif + INVERT_Z_DIR , // 5 Z2 + INVERT_Z_DIR , // 6 Z3 + INVERT_E0_DIR , // 7 E0 + INVERT_E1_DIR , // 8 E1 + INVERT_E2_DIR , // 9 E2 + INVERT_E3_DIR , //10 E3 + INVERT_E4_DIR , //11 E4 + INVERT_E5_DIR //12 E5 + }; volatile bool L6470_Marlin::spi_abort = false; bool L6470_Marlin::spi_active = false; -void L6470_Marlin::populate_chain_array() { +L6470_Marlin::L64XX_shadow_t L6470_Marlin::shadow; + +//uint32_t UVLO_ADC = 0x0400; // ADC undervoltage event + +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 + #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 + + 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 L6470_Marlin::get_stepper_status(const 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 L6470_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); + #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 L6470_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); + #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 L6470_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); + #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 } } @@ -295,11 +318,13 @@ inline void echo_oct_used(const float &oct, const bool stall) { serialprintPGM(stall ? PSTR(" (Stall") : PSTR(" (OCD")); L6470_ECHOLNPGM(" threshold)"); } -inline void err_out_of_bounds() { L6470_ECHOLNPGM("ERROR - motion out of bounds"); } +inline void err_out_of_bounds() { + L6470_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 L6470_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char* axis_mon[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 @@ -317,16 +342,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 @@ -336,19 +364,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 @@ -364,8 +390,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 @@ -381,8 +407,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 @@ -398,8 +424,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; } @@ -409,8 +435,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; @@ -534,27 +560,39 @@ 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* L6470_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 L6470_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 L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t axis) { // assumes status bits have been inverted #if ENABLED(L6470_CHITCHAT) char temp_buf[10]; - say_axis(axis); + L64helper.say_axis(axis); sprintf_P(temp_buf, PSTR(" %4x "), status); L6470_ECHO(temp_buf); print_bin(status); L6470_ECHOPGM(" THERMAL: "); - serialprintPGM((status & STATUS_TH_SD) ? PSTR("SHUTDOWN") : (status & STATUS_TH_WRN) ? PSTR("WARNING ") : PSTR("OK ")); + serialprintPGM((status & shadow.STATUS_AXIS_TH_SD) ? PSTR("SHUTDOWN") : (status & shadow.STATUS_AXIS_TH_WRN) ? PSTR("WARNING ") : PSTR("OK ")); L6470_ECHOPGM(" OVERCURRENT: "); - echo_yes_no(status & STATUS_OCD); + echo_yes_no(status & shadow.STATUS_AXIS_OCD); L6470_ECHOPGM(" STALL: "); - echo_yes_no(status & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)); + echo_yes_no(status & (shadow.STATUS_AXIS_STEP_LOSS_A | shadow.STATUS_AXIS_STEP_LOSS_B)); L6470_EOL(); #else UNUSED(status); UNUSED(axis); @@ -567,7 +605,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; @@ -580,59 +618,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 = L64helper.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; + } + + 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 L6470_monitor_update(uint8_t stepper_index, uint16_t status) { + void L6470_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; @@ -662,14 +707,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; @@ -682,7 +727,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); @@ -698,22 +743,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 @@ -724,13 +767,11 @@ 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() { static millis_t next_cOT = 0; @@ -739,43 +780,45 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis 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 @@ -790,4 +833,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 a29e40739e2e..eb1bc6cd11b6 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -49,46 +49,85 @@ #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 { +typedef enum : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 } L6470_axis_t; + +class L6470_Marlin : public L64XXHelper { public: + static const char * const index_to_axis[MAX_L6470]; + static bool index_to_dir[MAX_L6470]; - static uint8_t axis_xref[MAX_L6470]; - static char index_to_axis[MAX_L6470][3]; 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() {} + L6470_Marlin() { L64XX::set_helper(*this); } - 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(const 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], + 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 say_axis(const uint8_t axis, const bool label=true); + static void monitor_update(uint8_t stepper_index, uint16_t status); + + static void monitor_driver(); -private: - void populate_chain_array(); + 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); + + // ~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; + + //static uint32_t UVLO_ADC; // ADC undervoltage event + +protected: + // L64XXHelper methods + static void spi_init(); + static uint8_t transfer(uint8_t data, int16_t ss_pin); + static uint8_t transfer(uint8_t data, int16_t ss_pin, uint8_t chain_position); }; -extern L6470_Marlin L6470; +extern L6470_Marlin L64helper; diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 56e30bdcbe35..6cadb07ed6bf 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) @@ -358,10 +360,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); \ @@ -408,25 +406,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 (L64helper.spi_active) { + L64helper.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 + L64helper.transfer(L6470_buf, L64XX::chain[0]); // Send enough NOOPs to complete any command + L64helper.transfer(L6470_buf, L64XX::chain[0]); + L64helper.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]]; + // L64helper.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 L64helper.transfer + for (uint8_t j = 1; j <= L64XX::chain[0]; j++) + L6470_buf[j] = L64helper.dir_commands[L64XX::chain[j]]; + L64helper.transfer(L6470_buf, L64XX::chain[0]); // send the command stream to the drivers + } #endif // A small delay may be needed after changing direction @@ -1806,22 +1804,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..27503aec43b5 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 + L64helper.init_to_defaults(); #endif #if HAS_TRINAMIC @@ -1022,117 +1022,130 @@ 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.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; + } + } + else { + st.SetParam(st.L64XX_CONFIG,(st.GetParam(st.L64XX_CONFIG) | PWR_VCC_7_5V)); + 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; + } + } + st.getStatus(); + st.getStatus(); + } + + #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); + #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 eafb0c6eef87..e50b091e4231 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{ L64helper.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 bfb405208ada..f921169d565c 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 f31d4481b540..820e540e0c80 100644 --- a/config/default/Configuration.h +++ b/config/default/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/default/Configuration_adv.h b/config/default/Configuration_adv.h index 9ce2193c85d8..7035ca065e86 100644 --- a/config/default/Configuration_adv.h +++ b/config/default/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/platformio.ini b/platformio.ini index 5a1372d030db..61a5e0f9ff19 100644 --- a/platformio.ini +++ b/platformio.ini @@ -34,7 +34,7 @@ lib_deps = TMCStepper@<1.0.0 Adafruit NeoPixel@1.1.3 https://github.com/lincomatic/LiquidTWI2/archive/30aa480.zip - https://github.com/ameyer/Arduino-L6470/archive/dev.zip + https://github.com/ameyer/Arduino-L6470/archive/0.7.0.zip https://github.com/trinamic/TMC26XStepper/archive/c1921b4.zip https://github.com/mikeshub/SailfishLCD.git https://github.com/mikeshub/SailfishRGB_LED.git From ebdbb65c7e8304ee242fb818cd3864519a2d1217 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Mar 2019 18:56:31 -0600 Subject: [PATCH 03/23] Update examples for L64XX 0.7.0 --- .../examples/3DFabXYZ/Migbot/Configuration.h | 11 +- .../3DFabXYZ/Migbot/Configuration_adv.h | 217 ++++++++++-------- .../AlephObjects/TAZ4/Configuration.h | 11 +- .../AlephObjects/TAZ4/Configuration_adv.h | 217 ++++++++++-------- .../AliExpress/CL-260/Configuration.h | 11 +- .../AliExpress/UM2pExt/Configuration.h | 11 +- .../AliExpress/UM2pExt/Configuration_adv.h | 217 ++++++++++-------- config/examples/Anet/A2/Configuration.h | 11 +- config/examples/Anet/A2/Configuration_adv.h | 217 ++++++++++-------- config/examples/Anet/A2plus/Configuration.h | 11 +- .../examples/Anet/A2plus/Configuration_adv.h | 217 ++++++++++-------- config/examples/Anet/A6/Configuration.h | 11 +- config/examples/Anet/A6/Configuration_adv.h | 217 ++++++++++-------- config/examples/Anet/A8/Configuration.h | 11 +- config/examples/Anet/A8/Configuration_adv.h | 217 ++++++++++-------- config/examples/AnyCubic/i3/Configuration.h | 11 +- .../examples/AnyCubic/i3/Configuration_adv.h | 217 ++++++++++-------- config/examples/ArmEd/Configuration.h | 11 +- config/examples/ArmEd/Configuration_adv.h | 217 ++++++++++-------- config/examples/Azteeg/X5GT/Configuration.h | 11 +- .../BIBO/TouchX/cyclops/Configuration.h | 11 +- .../BIBO/TouchX/cyclops/Configuration_adv.h | 217 ++++++++++-------- .../BIBO/TouchX/default/Configuration.h | 11 +- .../BIBO/TouchX/default/Configuration_adv.h | 217 ++++++++++-------- config/examples/BQ/Hephestos/Configuration.h | 11 +- .../examples/BQ/Hephestos/Configuration_adv.h | 217 ++++++++++-------- .../examples/BQ/Hephestos_2/Configuration.h | 11 +- .../BQ/Hephestos_2/Configuration_adv.h | 217 ++++++++++-------- config/examples/BQ/WITBOX/Configuration.h | 11 +- config/examples/BQ/WITBOX/Configuration_adv.h | 217 ++++++++++-------- config/examples/Cartesio/Configuration.h | 11 +- config/examples/Cartesio/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/CR-10/Configuration.h | 11 +- .../Creality/CR-10/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/CR-10S/Configuration.h | 11 +- .../Creality/CR-10S/Configuration_adv.h | 217 ++++++++++-------- .../Creality/CR-10_5S/Configuration.h | 11 +- .../Creality/CR-10_5S/Configuration_adv.h | 217 ++++++++++-------- .../Creality/CR-10mini/Configuration.h | 11 +- .../Creality/CR-10mini/Configuration_adv.h | 217 ++++++++++-------- config/examples/Creality/CR-8/Configuration.h | 11 +- .../Creality/CR-8/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/Ender-2/Configuration.h | 11 +- .../Creality/Ender-2/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/Ender-3/Configuration.h | 11 +- .../Creality/Ender-3/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/Ender-4/Configuration.h | 11 +- .../Creality/Ender-4/Configuration_adv.h | 217 ++++++++++-------- config/examples/Einstart-S/Configuration.h | 11 +- .../examples/Einstart-S/Configuration_adv.h | 217 ++++++++++-------- config/examples/Felix/Configuration.h | 11 +- config/examples/Felix/Configuration_adv.h | 217 ++++++++++-------- config/examples/Felix/DUAL/Configuration.h | 11 +- .../FlashForge/CreatorPro/Configuration.h | 11 +- .../FlashForge/CreatorPro/Configuration_adv.h | 217 ++++++++++-------- .../FolgerTech/i3-2020/Configuration.h | 11 +- .../FolgerTech/i3-2020/Configuration_adv.h | 217 ++++++++++-------- .../examples/Formbot/Raptor/Configuration.h | 11 +- .../Formbot/Raptor/Configuration_adv.h | 217 ++++++++++-------- .../examples/Formbot/T_Rex_2+/Configuration.h | 11 +- .../Formbot/T_Rex_2+/Configuration_adv.h | 217 ++++++++++-------- .../examples/Formbot/T_Rex_3/Configuration.h | 11 +- .../Formbot/T_Rex_3/Configuration_adv.h | 217 ++++++++++-------- config/examples/Geeetech/A10M/Configuration.h | 11 +- .../Geeetech/A10M/Configuration_adv.h | 217 ++++++++++-------- config/examples/Geeetech/A20M/Configuration.h | 11 +- .../Geeetech/A20M/Configuration_adv.h | 217 ++++++++++-------- .../examples/Geeetech/GT2560/Configuration.h | 11 +- .../Geeetech/I3_Pro_X-GT2560/Configuration.h | 11 +- .../Geeetech/MeCreator2/Configuration.h | 11 +- .../Geeetech/MeCreator2/Configuration_adv.h | 217 ++++++++++-------- .../Prusa i3 Pro B/bltouch/Configuration.h | 11 +- .../Prusa i3 Pro B/noprobe/Configuration.h | 11 +- .../Geeetech/Prusa i3 Pro C/Configuration.h | 11 +- .../Prusa i3 Pro C/Configuration_adv.h | 217 ++++++++++-------- .../Geeetech/Prusa i3 Pro W/Configuration.h | 11 +- .../Prusa i3 Pro W/Configuration_adv.h | 217 ++++++++++-------- .../examples/Infitary/i3-M508/Configuration.h | 11 +- .../Infitary/i3-M508/Configuration_adv.h | 217 ++++++++++-------- config/examples/JGAurora/A5/Configuration.h | 11 +- .../examples/JGAurora/A5/Configuration_adv.h | 217 ++++++++++-------- config/examples/MakerParts/Configuration.h | 11 +- .../examples/MakerParts/Configuration_adv.h | 217 ++++++++++-------- config/examples/Malyan/M150/Configuration.h | 11 +- .../examples/Malyan/M150/Configuration_adv.h | 217 ++++++++++-------- config/examples/Malyan/M200/Configuration.h | 11 +- .../examples/Malyan/M200/Configuration_adv.h | 217 ++++++++++-------- .../Micromake/C1/basic/Configuration.h | 11 +- .../Micromake/C1/enhanced/Configuration.h | 11 +- .../Micromake/C1/enhanced/Configuration_adv.h | 217 ++++++++++-------- config/examples/Mks/Robin/Configuration.h | 11 +- config/examples/Mks/Robin/Configuration_adv.h | 217 ++++++++++-------- config/examples/Mks/Sbase/Configuration.h | 11 +- config/examples/Mks/Sbase/Configuration_adv.h | 217 ++++++++++-------- .../Printrbot/PrintrboardG2/Configuration.h | 11 +- .../examples/RapideLite/RL200/Configuration.h | 11 +- .../RapideLite/RL200/Configuration_adv.h | 217 ++++++++++-------- .../examples/RepRapPro/Huxley/Configuration.h | 11 +- .../RepRapWorld/Megatronics/Configuration.h | 11 +- config/examples/RigidBot/Configuration.h | 11 +- config/examples/RigidBot/Configuration_adv.h | 217 ++++++++++-------- config/examples/SCARA/Configuration.h | 11 +- config/examples/SCARA/Configuration_adv.h | 217 ++++++++++-------- config/examples/STM32F10/Configuration.h | 11 +- config/examples/STM32F4/Configuration.h | 11 +- config/examples/Sanguinololu/Configuration.h | 11 +- .../examples/Sanguinololu/Configuration_adv.h | 217 ++++++++++-------- config/examples/TheBorg/Configuration.h | 11 +- config/examples/TheBorg/Configuration_adv.h | 217 ++++++++++-------- config/examples/TinyBoy2/Configuration.h | 11 +- config/examples/TinyBoy2/Configuration_adv.h | 217 ++++++++++-------- config/examples/Tronxy/X1/Configuration.h | 11 +- config/examples/Tronxy/X3A/Configuration.h | 11 +- .../examples/Tronxy/X3A/Configuration_adv.h | 217 ++++++++++-------- config/examples/Tronxy/X5S-2E/Configuration.h | 11 +- .../Tronxy/X5S-2E/Configuration_adv.h | 217 ++++++++++-------- config/examples/Tronxy/X5S/Configuration.h | 11 +- config/examples/Tronxy/XY100/Configuration.h | 11 +- .../UltiMachine/Archim1/Configuration.h | 11 +- .../UltiMachine/Archim1/Configuration_adv.h | 217 ++++++++++-------- .../UltiMachine/Archim2/Configuration.h | 11 +- .../UltiMachine/Archim2/Configuration_adv.h | 217 ++++++++++-------- config/examples/VORONDesign/Configuration.h | 11 +- .../examples/VORONDesign/Configuration_adv.h | 217 ++++++++++-------- .../examples/Velleman/K8200/Configuration.h | 11 +- .../Velleman/K8200/Configuration_adv.h | 217 ++++++++++-------- .../examples/Velleman/K8400/Configuration.h | 11 +- .../Velleman/K8400/Configuration_adv.h | 217 ++++++++++-------- .../Velleman/K8400/Dual-head/Configuration.h | 11 +- .../examples/WASP/PowerWASP/Configuration.h | 11 +- .../WASP/PowerWASP/Configuration_adv.h | 217 ++++++++++-------- .../Wanhao/Duplicator 6/Configuration.h | 11 +- .../Wanhao/Duplicator 6/Configuration_adv.h | 217 ++++++++++-------- .../examples/adafruit/ST7565/Configuration.h | 11 +- .../delta/Anycubic/Kossel/Configuration.h | 11 +- .../delta/Anycubic/Kossel/Configuration_adv.h | 217 ++++++++++-------- .../FLSUN/auto_calibrate/Configuration.h | 11 +- .../FLSUN/auto_calibrate/Configuration_adv.h | 217 ++++++++++-------- .../delta/FLSUN/kossel/Configuration.h | 11 +- .../delta/FLSUN/kossel/Configuration_adv.h | 217 ++++++++++-------- .../delta/FLSUN/kossel_mini/Configuration.h | 11 +- .../FLSUN/kossel_mini/Configuration_adv.h | 217 ++++++++++-------- .../Geeetech/Rostock 301/Configuration.h | 11 +- .../Geeetech/Rostock 301/Configuration_adv.h | 217 ++++++++++-------- .../delta/Hatchbox_Alpha/Configuration.h | 11 +- .../examples/delta/MKS/SBASE/Configuration.h | 11 +- .../delta/MKS/SBASE/Configuration_adv.h | 217 ++++++++++-------- .../delta/Tevo Little Monster/Configuration.h | 11 +- .../Tevo Little Monster/Configuration_adv.h | 217 ++++++++++-------- config/examples/delta/generic/Configuration.h | 11 +- .../delta/generic/Configuration_adv.h | 217 ++++++++++-------- .../delta/kossel_mini/Configuration.h | 11 +- .../delta/kossel_mini/Configuration_adv.h | 217 ++++++++++-------- .../examples/delta/kossel_pro/Configuration.h | 11 +- .../examples/delta/kossel_xl/Configuration.h | 11 +- .../delta/kossel_xl/Configuration_adv.h | 217 ++++++++++-------- .../examples/gCreate/gMax1.5+/Configuration.h | 11 +- .../gCreate/gMax1.5+/Configuration_adv.h | 217 ++++++++++-------- config/examples/makibox/Configuration.h | 11 +- config/examples/makibox/Configuration_adv.h | 217 ++++++++++-------- config/examples/stm32f103ret6/Configuration.h | 11 +- config/examples/tvrrug/Round2/Configuration.h | 11 +- .../tvrrug/Round2/Configuration_adv.h | 217 ++++++++++-------- config/examples/wt150/Configuration.h | 11 +- config/examples/wt150/Configuration_adv.h | 217 ++++++++++-------- 165 files changed, 8745 insertions(+), 7902 deletions(-) diff --git a/config/examples/3DFabXYZ/Migbot/Configuration.h b/config/examples/3DFabXYZ/Migbot/Configuration.h index 6b4724034b21..bd767bab467a 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration.h +++ b/config/examples/3DFabXYZ/Migbot/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/3DFabXYZ/Migbot/Configuration_adv.h b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h index 7d615d8ded6b..f8b526d1485a 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 982c8f93126a..3e5d9dd91e9a 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/config/examples/AlephObjects/TAZ4/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/AlephObjects/TAZ4/Configuration_adv.h b/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 3a8491989d45..1e2c3eca4b9c 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 dc9bf048b0f6..2f7cbc6ec891 100644 --- a/config/examples/AliExpress/CL-260/Configuration.h +++ b/config/examples/AliExpress/CL-260/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/AliExpress/UM2pExt/Configuration.h b/config/examples/AliExpress/UM2pExt/Configuration.h index ec19c2f07c3a..0b8102d49269 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration.h +++ b/config/examples/AliExpress/UM2pExt/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/AliExpress/UM2pExt/Configuration_adv.h b/config/examples/AliExpress/UM2pExt/Configuration_adv.h index a2eea25cc7dc..9b4ae929cfa3 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration_adv.h +++ b/config/examples/AliExpress/UM2pExt/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 1d16c9380ea8..672351ff76ed 100644 --- a/config/examples/Anet/A2/Configuration.h +++ b/config/examples/Anet/A2/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/Anet/A2/Configuration_adv.h b/config/examples/Anet/A2/Configuration_adv.h index 556a346aca73..360d9460e86d 100644 --- a/config/examples/Anet/A2/Configuration_adv.h +++ b/config/examples/Anet/A2/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 55c622329ed0..ebfdbf0dde6f 100644 --- a/config/examples/Anet/A2plus/Configuration.h +++ b/config/examples/Anet/A2plus/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/Anet/A2plus/Configuration_adv.h b/config/examples/Anet/A2plus/Configuration_adv.h index 556a346aca73..360d9460e86d 100644 --- a/config/examples/Anet/A2plus/Configuration_adv.h +++ b/config/examples/Anet/A2plus/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 345aef206364..6c0b798eef3d 100644 --- a/config/examples/Anet/A6/Configuration.h +++ b/config/examples/Anet/A6/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/Anet/A6/Configuration_adv.h b/config/examples/Anet/A6/Configuration_adv.h index bcc44d7d0bfc..85ad32f5dc11 100644 --- a/config/examples/Anet/A6/Configuration_adv.h +++ b/config/examples/Anet/A6/Configuration_adv.h @@ -1666,12 +1666,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 @@ -1681,112 +1681,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 /** @@ -1812,7 +1825,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 a1dbf7bd4bc9..474d60bea859 100644 --- a/config/examples/Anet/A8/Configuration.h +++ b/config/examples/Anet/A8/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/Anet/A8/Configuration_adv.h b/config/examples/Anet/A8/Configuration_adv.h index e361c601c496..80f3c3113444 100644 --- a/config/examples/Anet/A8/Configuration_adv.h +++ b/config/examples/Anet/A8/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 307ab03f1f25..1a77c7588f97 100644 --- a/config/examples/AnyCubic/i3/Configuration.h +++ b/config/examples/AnyCubic/i3/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/AnyCubic/i3/Configuration_adv.h b/config/examples/AnyCubic/i3/Configuration_adv.h index 63a218b504af..25f8052fb3eb 100644 --- a/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/config/examples/AnyCubic/i3/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 2989c87b23e2..cee620bda11a 100644 --- a/config/examples/ArmEd/Configuration.h +++ b/config/examples/ArmEd/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/ArmEd/Configuration_adv.h b/config/examples/ArmEd/Configuration_adv.h index 7200c7173ffe..439e241c81af 100644 --- a/config/examples/ArmEd/Configuration_adv.h +++ b/config/examples/ArmEd/Configuration_adv.h @@ -1671,12 +1671,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 @@ -1686,112 +1686,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 /** @@ -1817,7 +1830,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 a8dabcf79c5f..7f95867e0fa2 100644 --- a/config/examples/Azteeg/X5GT/Configuration.h +++ b/config/examples/Azteeg/X5GT/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/BIBO/TouchX/cyclops/Configuration.h b/config/examples/BIBO/TouchX/cyclops/Configuration.h index a440d1f42a38..efe4467128df 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration.h +++ b/config/examples/BIBO/TouchX/cyclops/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/BIBO/TouchX/cyclops/Configuration_adv.h b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index 10e8795b07a1..b8017db5a5e3 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 b6d3ded90198..70b8ac52ee3c 100644 --- a/config/examples/BIBO/TouchX/default/Configuration.h +++ b/config/examples/BIBO/TouchX/default/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/BIBO/TouchX/default/Configuration_adv.h b/config/examples/BIBO/TouchX/default/Configuration_adv.h index 4c98d0ec730e..03cd522fd98e 100644 --- a/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 d6480f7e83f5..8c6053e59c53 100644 --- a/config/examples/BQ/Hephestos/Configuration.h +++ b/config/examples/BQ/Hephestos/Configuration.h @@ -610,12 +610,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 6eecdb6e748c..bc657a6d2ff6 100644 --- a/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/config/examples/BQ/Hephestos/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 2151e07dac34..d423dcd885a0 100644 --- a/config/examples/BQ/Hephestos_2/Configuration.h +++ b/config/examples/BQ/Hephestos_2/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/BQ/Hephestos_2/Configuration_adv.h b/config/examples/BQ/Hephestos_2/Configuration_adv.h index dfa563ea16a5..d47e9b570483 100644 --- a/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 90641ec6c441..abd13d76f6d1 100644 --- a/config/examples/BQ/WITBOX/Configuration.h +++ b/config/examples/BQ/WITBOX/Configuration.h @@ -610,12 +610,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 6eecdb6e748c..bc657a6d2ff6 100644 --- a/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/config/examples/BQ/WITBOX/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 500d07b97a36..a4f25a7d18d2 100644 --- a/config/examples/Cartesio/Configuration.h +++ b/config/examples/Cartesio/Configuration.h @@ -621,12 +621,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 f94d78db1ca1..cbf182a7b545 100644 --- a/config/examples/Cartesio/Configuration_adv.h +++ b/config/examples/Cartesio/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 53b7cf62725e..10ed91c9d890 100644 --- a/config/examples/Creality/CR-10/Configuration.h +++ b/config/examples/Creality/CR-10/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/Creality/CR-10/Configuration_adv.h b/config/examples/Creality/CR-10/Configuration_adv.h index 8eaae19b160b..5ab058c561a3 100644 --- a/config/examples/Creality/CR-10/Configuration_adv.h +++ b/config/examples/Creality/CR-10/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 1b491b8c97e0..286bb24072ce 100644 --- a/config/examples/Creality/CR-10S/Configuration.h +++ b/config/examples/Creality/CR-10S/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/Creality/CR-10S/Configuration_adv.h b/config/examples/Creality/CR-10S/Configuration_adv.h index 326955da6dea..440550e04395 100644 --- a/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 70d6ca38b109..a0b6c1bcfce0 100644 --- a/config/examples/Creality/CR-10_5S/Configuration.h +++ b/config/examples/Creality/CR-10_5S/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/Creality/CR-10_5S/Configuration_adv.h b/config/examples/Creality/CR-10_5S/Configuration_adv.h index 21fcfc18f171..593fbd1be181 100644 --- a/config/examples/Creality/CR-10_5S/Configuration_adv.h +++ b/config/examples/Creality/CR-10_5S/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 82b42063b508..2488ed7f70f8 100644 --- a/config/examples/Creality/CR-10mini/Configuration.h +++ b/config/examples/Creality/CR-10mini/Configuration.h @@ -641,12 +641,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 28319c76398d..de59abd84591 100644 --- a/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 f7216847b26a..6832509e2196 100644 --- a/config/examples/Creality/CR-8/Configuration.h +++ b/config/examples/Creality/CR-8/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/Creality/CR-8/Configuration_adv.h b/config/examples/Creality/CR-8/Configuration_adv.h index b141c6095903..84b433a428cf 100644 --- a/config/examples/Creality/CR-8/Configuration_adv.h +++ b/config/examples/Creality/CR-8/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 1731dbca6836..f9599a5f044c 100644 --- a/config/examples/Creality/Ender-2/Configuration.h +++ b/config/examples/Creality/Ender-2/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/Creality/Ender-2/Configuration_adv.h b/config/examples/Creality/Ender-2/Configuration_adv.h index b1f34b8ec2f8..ab910a5490d2 100644 --- a/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/config/examples/Creality/Ender-2/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 b599a5318e88..9760593d6cbd 100644 --- a/config/examples/Creality/Ender-3/Configuration.h +++ b/config/examples/Creality/Ender-3/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/Creality/Ender-3/Configuration_adv.h b/config/examples/Creality/Ender-3/Configuration_adv.h index e487926ba323..a71b1737d41f 100644 --- a/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 f43638adabec..20f50e9e9050 100644 --- a/config/examples/Creality/Ender-4/Configuration.h +++ b/config/examples/Creality/Ender-4/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/Creality/Ender-4/Configuration_adv.h b/config/examples/Creality/Ender-4/Configuration_adv.h index 9a0fb89c284f..bd043cb564a2 100644 --- a/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/config/examples/Creality/Ender-4/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 6837a1271576..fefbf421ecb5 100644 --- a/config/examples/Einstart-S/Configuration.h +++ b/config/examples/Einstart-S/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/Einstart-S/Configuration_adv.h b/config/examples/Einstart-S/Configuration_adv.h index 5dbfa8b61542..36e4646aa6b4 100644 --- a/config/examples/Einstart-S/Configuration_adv.h +++ b/config/examples/Einstart-S/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 c1f2d63cbb36..f7420c402734 100644 --- a/config/examples/Felix/Configuration.h +++ b/config/examples/Felix/Configuration.h @@ -603,12 +603,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 5bf58fb69c3a..7a5f54aca2cf 100644 --- a/config/examples/Felix/Configuration_adv.h +++ b/config/examples/Felix/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 64a60cbd393e..0fd9f6f56459 100644 --- a/config/examples/Felix/DUAL/Configuration.h +++ b/config/examples/Felix/DUAL/Configuration.h @@ -603,12 +603,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 bbfb02798714..6ec80b21e6a6 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration.h +++ b/config/examples/FlashForge/CreatorPro/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/FlashForge/CreatorPro/Configuration_adv.h b/config/examples/FlashForge/CreatorPro/Configuration_adv.h index edb8b3e7b419..c2c7fe591407 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -1666,12 +1666,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 @@ -1681,112 +1681,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 /** @@ -1812,7 +1825,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 79a320c71cc9..22a965ecfae5 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration.h +++ b/config/examples/FolgerTech/i3-2020/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/FolgerTech/i3-2020/Configuration_adv.h b/config/examples/FolgerTech/i3-2020/Configuration_adv.h index fc8c2d3c4a64..15407d2d70e1 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 2994c1efc0ed..8b6a9ec6633a 100644 --- a/config/examples/Formbot/Raptor/Configuration.h +++ b/config/examples/Formbot/Raptor/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/Formbot/Raptor/Configuration_adv.h b/config/examples/Formbot/Raptor/Configuration_adv.h index d163e72ed61a..abbe86518e47 100644 --- a/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/config/examples/Formbot/Raptor/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 6ff1d327a916..21da1db37845 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration.h @@ -651,12 +651,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 ee2c993dafc3..1b4423070b70 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -1671,12 +1671,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 @@ -1686,112 +1686,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 /** @@ -1817,7 +1830,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 48b7b2302eeb..0b5dd2a4db30 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration.h +++ b/config/examples/Formbot/T_Rex_3/Configuration.h @@ -631,12 +631,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 6bd3aa21a3f6..a0277aa6bbf3 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -1672,12 +1672,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 @@ -1687,112 +1687,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 /** @@ -1818,7 +1831,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 91da7829db9d..bcbe32244d5e 100644 --- a/config/examples/Geeetech/A10M/Configuration.h +++ b/config/examples/Geeetech/A10M/Configuration.h @@ -605,12 +605,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 7518e018a218..7548fe3a8565 100644 --- a/config/examples/Geeetech/A10M/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 a6345ed2953d..0077e96c35f0 100644 --- a/config/examples/Geeetech/A20M/Configuration.h +++ b/config/examples/Geeetech/A20M/Configuration.h @@ -605,12 +605,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 326234366d43..7b1cf4b24c47 100644 --- a/config/examples/Geeetech/A20M/Configuration_adv.h +++ b/config/examples/Geeetech/A20M/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 8bf0b084fe3c..1840ed8e3324 100644 --- a/config/examples/Geeetech/GT2560/Configuration.h +++ b/config/examples/Geeetech/GT2560/Configuration.h @@ -637,12 +637,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 7e20661edea1..6022cc6bda9c 100644 --- a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/config/examples/Geeetech/I3_Pro_X-GT2560/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/Geeetech/MeCreator2/Configuration.h b/config/examples/Geeetech/MeCreator2/Configuration.h index d5d541909a8b..c06569782712 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration.h +++ b/config/examples/Geeetech/MeCreator2/Configuration.h @@ -629,12 +629,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 bf2b36498ccf..1d285770f747 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 70128c3133c5..fa2de17bc43a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -637,12 +637,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 fc800d831238..b9d95114dd49 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -637,12 +637,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 959a96114112..d10bc018ebe8 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/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/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index 5433ccf1bc66..13cc1194f9d0 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 fa60ead3ab44..e04fc16b3025 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/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/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index 5433ccf1bc66..13cc1194f9d0 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 9bd026c0c84a..cab6472bee79 100644 --- a/config/examples/Infitary/i3-M508/Configuration.h +++ b/config/examples/Infitary/i3-M508/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/Infitary/i3-M508/Configuration_adv.h b/config/examples/Infitary/i3-M508/Configuration_adv.h index ad3709f0cd39..d01591d90e29 100644 --- a/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 013d7b29cb6a..d1cc790f352d 100644 --- a/config/examples/JGAurora/A5/Configuration.h +++ b/config/examples/JGAurora/A5/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/JGAurora/A5/Configuration_adv.h b/config/examples/JGAurora/A5/Configuration_adv.h index b762526dc438..02fe8f1183ee 100644 --- a/config/examples/JGAurora/A5/Configuration_adv.h +++ b/config/examples/JGAurora/A5/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 d27314af5924..3fec3d2bb50e 100644 --- a/config/examples/MakerParts/Configuration.h +++ b/config/examples/MakerParts/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/MakerParts/Configuration_adv.h b/config/examples/MakerParts/Configuration_adv.h index faab71a951b0..3ab817e5f406 100644 --- a/config/examples/MakerParts/Configuration_adv.h +++ b/config/examples/MakerParts/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 a6cdb98bf391..28d389469077 100644 --- a/config/examples/Malyan/M150/Configuration.h +++ b/config/examples/Malyan/M150/Configuration.h @@ -631,12 +631,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 72d7f066deae..e4335269c670 100644 --- a/config/examples/Malyan/M150/Configuration_adv.h +++ b/config/examples/Malyan/M150/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 dfa4436845cf..2a8a90e6f054 100644 --- a/config/examples/Malyan/M200/Configuration.h +++ b/config/examples/Malyan/M200/Configuration.h @@ -621,12 +621,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 2435fe5ab8b5..2035aa8a6036 100644 --- a/config/examples/Malyan/M200/Configuration_adv.h +++ b/config/examples/Malyan/M200/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 f1bb827cd2c9..ecefc25d5bb2 100644 --- a/config/examples/Micromake/C1/basic/Configuration.h +++ b/config/examples/Micromake/C1/basic/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/Micromake/C1/enhanced/Configuration.h b/config/examples/Micromake/C1/enhanced/Configuration.h index 0d54b8d57548..1aa075889041 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/config/examples/Micromake/C1/enhanced/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/Micromake/C1/enhanced/Configuration_adv.h b/config/examples/Micromake/C1/enhanced/Configuration_adv.h index 9ce2193c85d8..7035ca065e86 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 eed09a285f6d..311c6a8b36e1 100644 --- a/config/examples/Mks/Robin/Configuration.h +++ b/config/examples/Mks/Robin/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/Mks/Robin/Configuration_adv.h b/config/examples/Mks/Robin/Configuration_adv.h index 34134ff1850a..057a6bdcbfdd 100644 --- a/config/examples/Mks/Robin/Configuration_adv.h +++ b/config/examples/Mks/Robin/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 712a3d39c023..840c91d93bc8 100644 --- a/config/examples/Mks/Sbase/Configuration.h +++ b/config/examples/Mks/Sbase/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 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 dd646d1e7f90..20261d677c84 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 ce508b9b9d3a..36ccf2a9fa11 100644 --- a/config/examples/Printrbot/PrintrboardG2/Configuration.h +++ b/config/examples/Printrbot/PrintrboardG2/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.h b/config/examples/RapideLite/RL200/Configuration.h index 65634f84108a..0cdc6e4844fa 100644 --- a/config/examples/RapideLite/RL200/Configuration.h +++ b/config/examples/RapideLite/RL200/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 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 0ce179916dfc..ae0b9e6b96f3 100644 --- a/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/config/examples/RapideLite/RL200/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 171ee06807de..5620adf1d062 100644 --- a/config/examples/RepRapPro/Huxley/Configuration.h +++ b/config/examples/RepRapPro/Huxley/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/RepRapWorld/Megatronics/Configuration.h b/config/examples/RepRapWorld/Megatronics/Configuration.h index 392222916f9d..f9a6b2f79a10 100644 --- a/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/config/examples/RepRapWorld/Megatronics/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/RigidBot/Configuration.h b/config/examples/RigidBot/Configuration.h index a9a00acac8b6..2ff97fa1e532 100644 --- a/config/examples/RigidBot/Configuration.h +++ b/config/examples/RigidBot/Configuration.h @@ -618,12 +618,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 6d3b43f996e5..07066783f021 100644 --- a/config/examples/RigidBot/Configuration_adv.h +++ b/config/examples/RigidBot/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 e4a785f2baa2..7e9108f896ef 100644 --- a/config/examples/SCARA/Configuration.h +++ b/config/examples/SCARA/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/SCARA/Configuration_adv.h b/config/examples/SCARA/Configuration_adv.h index 75967fa930cf..fa5ba6d53483 100644 --- a/config/examples/SCARA/Configuration_adv.h +++ b/config/examples/SCARA/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 9dccbbb31bf2..c0237f377aa9 100644 --- a/config/examples/STM32F10/Configuration.h +++ b/config/examples/STM32F10/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/STM32F4/Configuration.h b/config/examples/STM32F4/Configuration.h index b18e5089aa34..86064779e340 100644 --- a/config/examples/STM32F4/Configuration.h +++ b/config/examples/STM32F4/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/Sanguinololu/Configuration.h b/config/examples/Sanguinololu/Configuration.h index cc1a9b460453..0128173e3dd8 100644 --- a/config/examples/Sanguinololu/Configuration.h +++ b/config/examples/Sanguinololu/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/Sanguinololu/Configuration_adv.h b/config/examples/Sanguinololu/Configuration_adv.h index e19fd9d5d54a..1112d5387a62 100644 --- a/config/examples/Sanguinololu/Configuration_adv.h +++ b/config/examples/Sanguinololu/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 090ddf338e12..3d692c75d3af 100644 --- a/config/examples/TheBorg/Configuration.h +++ b/config/examples/TheBorg/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/TheBorg/Configuration_adv.h b/config/examples/TheBorg/Configuration_adv.h index 73e73748efc2..82a1bccd92cf 100644 --- a/config/examples/TheBorg/Configuration_adv.h +++ b/config/examples/TheBorg/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 fd04a56637f2..dd5e09c51a3d 100644 --- a/config/examples/TinyBoy2/Configuration.h +++ b/config/examples/TinyBoy2/Configuration.h @@ -673,12 +673,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 2c4327cc7bf8..d2e37c75879b 100644 --- a/config/examples/TinyBoy2/Configuration_adv.h +++ b/config/examples/TinyBoy2/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 6bc14774596b..62a795dbe914 100644 --- a/config/examples/Tronxy/X1/Configuration.h +++ b/config/examples/Tronxy/X1/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/X3A/Configuration.h b/config/examples/Tronxy/X3A/Configuration.h index 7230e66a609d..0bcb848b21f6 100644 --- a/config/examples/Tronxy/X3A/Configuration.h +++ b/config/examples/Tronxy/X3A/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/X3A/Configuration_adv.h b/config/examples/Tronxy/X3A/Configuration_adv.h index bd326a90e6f9..b2b0943d8040 100644 --- a/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/config/examples/Tronxy/X3A/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 0a544b169d02..ff089ff44432 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration.h +++ b/config/examples/Tronxy/X5S-2E/Configuration.h @@ -641,12 +641,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 4e3e952cd631..cca6d49375bc 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 6ee62b534bba..c0f7e4733b67 100644 --- a/config/examples/Tronxy/X5S/Configuration.h +++ b/config/examples/Tronxy/X5S/Configuration.h @@ -621,12 +621,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 022944463107..055142e953ae 100644 --- a/config/examples/Tronxy/XY100/Configuration.h +++ b/config/examples/Tronxy/XY100/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/UltiMachine/Archim1/Configuration.h b/config/examples/UltiMachine/Archim1/Configuration.h index e3155357a95a..4a03b3ddde9a 100644 --- a/config/examples/UltiMachine/Archim1/Configuration.h +++ b/config/examples/UltiMachine/Archim1/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 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 b74011897086..18d44f399db0 100644 --- a/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 8553fbaf0e51..56e6f2bdd1f1 100644 --- a/config/examples/UltiMachine/Archim2/Configuration.h +++ b/config/examples/UltiMachine/Archim2/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 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 35f286126c03..7a88aaf1f3c4 100644 --- a/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 54e4a44f49b1..6880ae746a9b 100644 --- a/config/examples/VORONDesign/Configuration.h +++ b/config/examples/VORONDesign/Configuration.h @@ -631,12 +631,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 2141406e3d0e..decd9d4449c3 100644 --- a/config/examples/VORONDesign/Configuration_adv.h +++ b/config/examples/VORONDesign/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 704c40cbcf5d..95d1dcd09cc5 100644 --- a/config/examples/Velleman/K8200/Configuration.h +++ b/config/examples/Velleman/K8200/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/Velleman/K8200/Configuration_adv.h b/config/examples/Velleman/K8200/Configuration_adv.h index 207db23a3bdb..1f3f3b46db56 100644 --- a/config/examples/Velleman/K8200/Configuration_adv.h +++ b/config/examples/Velleman/K8200/Configuration_adv.h @@ -1680,12 +1680,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 @@ -1695,112 +1695,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 /** @@ -1826,7 +1839,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 97d4340a19e4..56828c8dbc2c 100644 --- a/config/examples/Velleman/K8400/Configuration.h +++ b/config/examples/Velleman/K8400/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/Velleman/K8400/Configuration_adv.h b/config/examples/Velleman/K8400/Configuration_adv.h index a5e766a53440..16a2fcd18a82 100644 --- a/config/examples/Velleman/K8400/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 46fa6748ad0a..2a89c4b08e0e 100644 --- a/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/config/examples/Velleman/K8400/Dual-head/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/WASP/PowerWASP/Configuration.h b/config/examples/WASP/PowerWASP/Configuration.h index 0378317d9f0c..75caa5e6bdfd 100644 --- a/config/examples/WASP/PowerWASP/Configuration.h +++ b/config/examples/WASP/PowerWASP/Configuration.h @@ -641,12 +641,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 2500b3763b82..05d256658a4f 100644 --- a/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 3e7abb3aba42..9f9f75603d4b 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration.h +++ b/config/examples/Wanhao/Duplicator 6/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/Wanhao/Duplicator 6/Configuration_adv.h b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 63f7d236103c..14982d62a11d 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 0046664dd306..fbc6ac9271f0 100644 --- a/config/examples/adafruit/ST7565/Configuration.h +++ b/config/examples/adafruit/ST7565/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/delta/Anycubic/Kossel/Configuration.h b/config/examples/delta/Anycubic/Kossel/Configuration.h index ba5368bdb5cc..072ca489cd20 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration.h @@ -743,12 +743,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 662b40b0cfdd..77bd55d3ec71 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 deeb1401ba03..79e0137eff84 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -695,12 +695,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 1d33bb3b7827..851e4e269f52 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 9a2d70407c3e..7a3b8e649a51 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/config/examples/delta/FLSUN/kossel/Configuration.h @@ -695,12 +695,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 1d33bb3b7827..851e4e269f52 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 085142651d3f..28da51467c59 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -695,12 +695,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 884a681d68ca..e31f624f6298 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 48c99c8b70a9..f7d650e2a026 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration.h @@ -685,12 +685,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 884a681d68ca..e31f624f6298 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 5037d498b705..7747c5fd2992 100644 --- a/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -700,12 +700,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 b8c3b29d9535..b45a6d596fc3 100644 --- a/config/examples/delta/MKS/SBASE/Configuration.h +++ b/config/examples/delta/MKS/SBASE/Configuration.h @@ -685,12 +685,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 1ac933b9aeb2..95a7c2446943 100644 --- a/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 ef72b1bd6d2f..1ced7ba84686 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration.h +++ b/config/examples/delta/Tevo Little Monster/Configuration.h @@ -689,12 +689,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 0c0dab8b5d86..0c7706910cfd 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 4ff806cf65ef..6452ff688e75 100644 --- a/config/examples/delta/generic/Configuration.h +++ b/config/examples/delta/generic/Configuration.h @@ -685,12 +685,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 884a681d68ca..e31f624f6298 100644 --- a/config/examples/delta/generic/Configuration_adv.h +++ b/config/examples/delta/generic/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 aa8f30a6a872..dd51ba250519 100644 --- a/config/examples/delta/kossel_mini/Configuration.h +++ b/config/examples/delta/kossel_mini/Configuration.h @@ -685,12 +685,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 540063dc1fa5..3f908be113f3 100644 --- a/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/kossel_mini/Configuration_adv.h @@ -1668,12 +1668,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 @@ -1683,112 +1683,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 /** @@ -1814,7 +1827,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 c0e7ebb5ad0e..662522abe283 100644 --- a/config/examples/delta/kossel_pro/Configuration.h +++ b/config/examples/delta/kossel_pro/Configuration.h @@ -671,12 +671,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 16de2a609358..78776b6b5896 100644 --- a/config/examples/delta/kossel_xl/Configuration.h +++ b/config/examples/delta/kossel_xl/Configuration.h @@ -689,12 +689,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 c5493be20b77..04fbe5701d1d 100644 --- a/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/config/examples/delta/kossel_xl/Configuration_adv.h @@ -1669,12 +1669,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 @@ -1684,112 +1684,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 /** @@ -1815,7 +1828,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 65bc3be325b9..cd211d42bd1f 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/config/examples/gCreate/gMax1.5+/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/gCreate/gMax1.5+/Configuration_adv.h b/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 10a97d6cd70e..654594ac4ff6 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 3a58f2fed0b8..61744ee7da21 100644 --- a/config/examples/makibox/Configuration.h +++ b/config/examples/makibox/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/makibox/Configuration_adv.h b/config/examples/makibox/Configuration_adv.h index 89f009386e06..9d7ead8ece92 100644 --- a/config/examples/makibox/Configuration_adv.h +++ b/config/examples/makibox/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 325527951d71..b76c511aed03 100644 --- a/config/examples/stm32f103ret6/Configuration.h +++ b/config/examples/stm32f103ret6/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/tvrrug/Round2/Configuration.h b/config/examples/tvrrug/Round2/Configuration.h index 467f780a4cd0..7beb53343694 100644 --- a/config/examples/tvrrug/Round2/Configuration.h +++ b/config/examples/tvrrug/Round2/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/tvrrug/Round2/Configuration_adv.h b/config/examples/tvrrug/Round2/Configuration_adv.h index 0285eb672e34..df1c933a86dc 100644 --- a/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/config/examples/tvrrug/Round2/Configuration_adv.h @@ -1667,12 +1667,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 @@ -1682,112 +1682,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 /** @@ -1813,7 +1826,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 48e13f0d3df9..88919518c2b4 100644 --- a/config/examples/wt150/Configuration.h +++ b/config/examples/wt150/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/wt150/Configuration_adv.h b/config/examples/wt150/Configuration_adv.h index 3657e70667dc..6b3b2d1d6702 100644 --- a/config/examples/wt150/Configuration_adv.h +++ b/config/examples/wt150/Configuration_adv.h @@ -1668,12 +1668,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 @@ -1683,112 +1683,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 /** @@ -1814,7 +1827,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS From 375dd39f1bcb4b12375d4b0a92fa2b333c8640ba Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Sat, 2 Mar 2019 16:51:10 -0600 Subject: [PATCH 04/23] misc bug fixes, external SPI linking doesn't work --- Marlin/src/core/drivers.h | 8 ++++---- Marlin/src/libs/L6470/L6470_Marlin.cpp | 8 ++++---- Marlin/src/libs/L6470/L6470_Marlin.h | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index abb72127ce0b..ffa46c1c1856 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -54,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) ((ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(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)) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index f886bf263ac9..d8d92df3fc27 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -137,7 +137,7 @@ void L6470_Marlin::init() { // Set up SPI and then init chips * 3. copy status layout * 4. make all error bits active low (if needed) */ -uint16_t L6470_Marlin::get_stepper_status(const L64XX &st) { +uint16_t L6470_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; @@ -167,7 +167,7 @@ uint16_t L6470_Marlin::get_status(const L6470_axis_t axis) { #define STATUS_L6470(Q) get_stepper_status(stepper##Q) - switch (axis) { + switch ((uint8_t)axis) { #if AXIS_IS_L64XX(X) case X : return STATUS_L6470(X); #endif @@ -216,7 +216,7 @@ uint32_t L6470_Marlin::get_param(const L6470_axis_t axis, const uint8_t param) { #define GET_L6470_PARAM(Q) L6470_GETPARAM(param,Q) - switch (axis) { + switch ((uint8_t)axis) { #if AXIS_IS_L64XX(X) case X : return GET_L6470_PARAM(X); #endif @@ -265,7 +265,7 @@ void L6470_Marlin::set_param(const L6470_axis_t axis, const uint8_t param, const #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value) - switch (axis) { + switch ((uint8_t)axis) { #if AXIS_IS_L64XX(X) case X : SET_L6470_PARAM(X); #endif diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index eb1bc6cd11b6..7728c1e93531 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -22,6 +22,7 @@ #pragma once #include "../../inc/MarlinConfig.h" +#include "../../pins/pins.h" #include @@ -71,7 +72,7 @@ class L6470_Marlin : public L64XXHelper { static void init(); static void init_to_defaults(); - static uint16_t get_stepper_status(const L64XX &st); + static uint16_t get_stepper_status(L64XX st); static uint16_t get_status(const L6470_axis_t axis); From 203f43f4029031c035fbd5ead8c2102006e2dbbb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Mar 2019 17:53:36 -0600 Subject: [PATCH 05/23] Use 'default' to suppress enum warning --- Marlin/src/libs/L6470/L6470_Marlin.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index d8d92df3fc27..d634ec9ada22 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -167,7 +167,8 @@ uint16_t L6470_Marlin::get_status(const L6470_axis_t axis) { #define STATUS_L6470(Q) get_stepper_status(stepper##Q) - switch ((uint8_t)axis) { + switch (axis) { + default: break; #if AXIS_IS_L64XX(X) case X : return STATUS_L6470(X); #endif @@ -216,7 +217,8 @@ uint32_t L6470_Marlin::get_param(const L6470_axis_t axis, const uint8_t param) { #define GET_L6470_PARAM(Q) L6470_GETPARAM(param,Q) - switch ((uint8_t)axis) { + switch (axis) { + default: break; #if AXIS_IS_L64XX(X) case X : return GET_L6470_PARAM(X); #endif @@ -265,7 +267,8 @@ void L6470_Marlin::set_param(const L6470_axis_t axis, const uint8_t param, const #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value) - switch ((uint8_t)axis) { + switch (axis) { + default: break; #if AXIS_IS_L64XX(X) case X : SET_L6470_PARAM(X); #endif From f1e4039ba1238583a59942cfc05f71681f96df0d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Mar 2019 17:55:37 -0600 Subject: [PATCH 06/23] Pass by reference instead of copying --- Marlin/src/libs/L6470/L6470_Marlin.cpp | 2 +- Marlin/src/libs/L6470/L6470_Marlin.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index d634ec9ada22..aad29f1519bd 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -137,7 +137,7 @@ void L6470_Marlin::init() { // Set up SPI and then init chips * 3. copy status layout * 4. make all error bits active low (if needed) */ -uint16_t L6470_Marlin::get_stepper_status(L64XX st) { +uint16_t L6470_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; diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index 7728c1e93531..895d83e62def 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -22,7 +22,6 @@ #pragma once #include "../../inc/MarlinConfig.h" -#include "../../pins/pins.h" #include @@ -72,7 +71,7 @@ class L6470_Marlin : public L64XXHelper { static void init(); static void init_to_defaults(); - static uint16_t get_stepper_status(L64XX st); + static uint16_t get_stepper_status(L64XX &st); static uint16_t get_status(const L6470_axis_t axis); From f2acb187b9dc704261c9b808f2e1196f8b33da10 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Mar 2019 21:52:41 -0600 Subject: [PATCH 07/23] Set helper as a pointer instead of a reference --- Marlin/src/libs/L6470/L6470_Marlin.h | 2 +- platformio.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index 895d83e62def..c7550b209194 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -66,7 +66,7 @@ class L6470_Marlin : public L64XXHelper { static volatile bool spi_abort; static bool spi_active; - L6470_Marlin() { L64XX::set_helper(*this); } + L6470_Marlin() { L64XX::set_helper(this); } static void init(); static void init_to_defaults(); diff --git a/platformio.ini b/platformio.ini index 61a5e0f9ff19..5a1372d030db 100644 --- a/platformio.ini +++ b/platformio.ini @@ -34,7 +34,7 @@ lib_deps = TMCStepper@<1.0.0 Adafruit NeoPixel@1.1.3 https://github.com/lincomatic/LiquidTWI2/archive/30aa480.zip - https://github.com/ameyer/Arduino-L6470/archive/0.7.0.zip + https://github.com/ameyer/Arduino-L6470/archive/dev.zip https://github.com/trinamic/TMC26XStepper/archive/c1921b4.zip https://github.com/mikeshub/SailfishLCD.git https://github.com/mikeshub/SailfishRGB_LED.git From 33affc4bc1fe041b53a10d17864dd652bb6285e7 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Mon, 4 Mar 2019 08:09:26 -0600 Subject: [PATCH 08/23] fix formatting bugs and fix slew rate problem Need to clear the powerup/reset error bits before can set slew rate on L6480/powerSTEP01 --- Marlin/src/gcode/feature/L6470/M122.cpp | 3 ++- Marlin/src/gcode/feature/L6470/M906.cpp | 2 +- Marlin/src/module/stepper_indirection.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/src/gcode/feature/L6470/M122.cpp b/Marlin/src/gcode/feature/L6470/M122.cpp index 2b1d5ac30153..b042c2a66bc3 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -106,7 +106,8 @@ inline void L6470_say_status(const L6470_axis_t axis) { } 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_ECHOLNPGM(" STEP-CLOCK MODE:"); echo_yes_no(sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD); + SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no(sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD); + SERIAL_EOL(); } /** diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index 2faaf3d8b395..b5aa0dea182d 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -140,7 +140,7 @@ void L6470_report_current(L64XX &motor, const L6470_axis_t axis) { } } else { - switch (motor.GetParam(L6470_GATECFG1)) { + 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; } diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper_indirection.cpp index 27503aec43b5..6c76759c6b0b 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper_indirection.cpp @@ -1089,9 +1089,13 @@ void reset_stepper_drivers() { 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: @@ -1100,8 +1104,6 @@ void reset_stepper_drivers() { case 3: st.SetParam(L6470_GATECFG1, CONFIG1_SR_980V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_980V_us); break; } } - st.getStatus(); - st.getStatus(); } #define L6470_INIT_CHIP(Q) L6470_init_chip(stepper##Q, Q##_MICROSTEPS, Q##_OVERCURRENT, Q##_STALLCURRENT, Q##_MAX_VOLTAGE, Q##_SLEW_RATE) From 64676b92c130823b1d185d4a1d703a3aa7a2d556 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Sun, 10 Mar 2019 03:42:56 -0500 Subject: [PATCH 09/23] axis_mon fix Change the way the array axis_mon is defined and how it's passed to the get_user_input function. --- Marlin/src/gcode/feature/L6470/M916-918.cpp | 7 ++++--- Marlin/src/libs/L6470/L6470_Marlin.cpp | 3 ++- Marlin/src/libs/L6470/L6470_Marlin.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index 1605f0577e90..af0a309c68db 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -53,6 +53,7 @@ /** * This routine is also useful for determining the approximate KVAL_HOLD + * where the stepper stops losing steps. The sound will get noticeably quieter * as it stops losing steps. */ @@ -62,7 +63,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPGM("M916"); // Variables used by L64helper.get_user_input function - some may not be used - char *axis_mon[3] = { " ", " ", " " }; // list of Axes to be monitored + 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; @@ -179,7 +180,7 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("M917"); - char *axis_mon[3] = { " ", " ", " " }; // list of axes to be monitored + 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; @@ -453,7 +454,7 @@ void GcodeSuite::M918() { L6470_ECHOLNPGM("M918"); - char *axis_mon[3] = { " ", " ", " " }; // List of axes to monitor + 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; diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index aad29f1519bd..846d403abc35 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -141,6 +141,7 @@ uint16_t L6470_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.BOB_TEMP = st.bob_temp; 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; @@ -325,7 +326,7 @@ inline void err_out_of_bounds() { L6470_ECHOLNPGM("ERROR - motion out of bounds"); } -bool L6470_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char* axis_mon[3], +bool L6470_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 ) { diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index c7550b209194..dcfebb71ea74 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -81,7 +81,7 @@ class L6470_Marlin : public L64XXHelper { //static void send_command(const L6470_axis_t axis, uint8_t command); - static bool get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char* axis_mon[3], + 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); From 74a87f17cb4fd46d97bb0d6574416f6dae3645a6 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Sun, 10 Mar 2019 03:49:47 -0500 Subject: [PATCH 10/23] remove unintended changes --- Marlin/src/gcode/feature/L6470/M916-918.cpp | 1 - Marlin/src/libs/L6470/L6470_Marlin.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index af0a309c68db..be305830c675 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -53,7 +53,6 @@ /** * This routine is also useful for determining the approximate KVAL_HOLD - * where the stepper stops losing steps. The sound will get noticeably quieter * as it stops losing steps. */ diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index 846d403abc35..b1a2b71fac28 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -141,7 +141,6 @@ uint16_t L6470_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.BOB_TEMP = st.bob_temp; 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; From 5449cfb43dd542cbe7b4649ceccccd85329766ab Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Tue, 12 Mar 2019 05:10:30 -0500 Subject: [PATCH 11/23] revert to handlers (pointers) method FULLY FUNCTIONAL using optional external SPI linked via code within Marlin classes. 1) Went back to the handler/pointer method 2) removed helper class from L6470.h 3) renamed L6470_Marlin class to L64XX_MARLIN 4) removed all helper code and renamed anything that had "helper" in it. --- Marlin/src/HAL/shared/HAL_spi_L6470.cpp | 16 +++---- Marlin/src/Marlin.cpp | 4 +- Marlin/src/gcode/calibrate/G28.cpp | 2 +- Marlin/src/gcode/feature/L6470/M122.cpp | 24 +++++----- Marlin/src/gcode/feature/L6470/M906.cpp | 14 +++--- Marlin/src/gcode/feature/L6470/M916-918.cpp | 50 ++++++++++----------- Marlin/src/gcode/host/M114.cpp | 2 +- Marlin/src/libs/L6470/L6470_Marlin.cpp | 47 ++++++++++--------- Marlin/src/libs/L6470/L6470_Marlin.h | 18 ++++---- Marlin/src/module/stepper.cpp | 18 ++++---- Marlin/src/module/stepper_indirection.cpp | 5 ++- Marlin/src/module/stepper_indirection.h | 2 +- 12 files changed, 105 insertions(+), 97 deletions(-) diff --git a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp index df6c02f1579b..3e15f0c1b834 100644 --- a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp +++ b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp @@ -74,9 +74,9 @@ inline uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3 } /** - * L64XXHelper methods for SPI init and transfer + * L64XX methods for SPI init and transfer */ -void L6470_Marlin::spi_init() { +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); @@ -89,25 +89,25 @@ void L6470_Marlin::spi_init() { OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); } -uint8_t L6470_Marlin::transfer(uint8_t data, int16_t ss_pin) { +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); 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; } -uint8_t L6470_Marlin::transfer(uint8_t data, int16_t ss_pin, uint8_t chain_position) { +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); - for (uint8_t i = L64XX::chain[0]; (i >= 1) && !L64helper.spi_abort; i--) { // stop sending data if spi_abort is active + 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 @@ -121,7 +121,7 @@ uint8_t L6470_Marlin::transfer(uint8_t data, int16_t ss_pin, uint8_t chain_posit /** * Platform-supplied L6470 buffer transfer method */ -void L6470_Marlin::transfer(uint8_t L6470_buf[], const uint8_t length) { +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 diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index e08a607336cb..f34af1b6c5a4 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -635,7 +635,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - L64helper.monitor_driver(); + L64xx_MARLIN.monitor_driver(); #endif // Limit check_axes_activity frequency to 10Hz @@ -840,7 +840,7 @@ void setup() { #endif #if HAS_L64XX - L64helper.init(); // setup SPI and init chips + L64xx_MARLIN.init(); // setup SPI and init chips #endif #if ENABLED(MAX7219_DEBUG) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 75ba6d177edd..421dd7e7fb90 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -466,7 +466,7 @@ void GcodeSuite::G28(const bool always_home_all) { }; for (uint8_t j = 1; j <= L64XX::chain[0]; j++) { const uint8_t cv = L64XX::chain[j]; - L64helper.set_param((L6470_axis_t)cv, L6470_ABS_POS, stepper.position(L6470_axis_xref[cv])); + 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 b042c2a66bc3..103eac3635f3 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -34,20 +34,20 @@ inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PS void L6470_status_decode(const uint16_t status, const L6470_axis_t axis) { if (Marlin_L6470.spi_abort) return; // don't do anything if set_directions() has occurred - if (L64helper.spi_abort) return; // don't do anything if set_directions() has occurred - L64helper.say_axis(axis); + if (L64xx_MARLIN.spi_abort) return; // don't do anything if set_directions() has occurred + L64xx_MARLIN.say_axis(axis); #if ENABLED(L6470_CHITCHAT) char temp_buf[20]; sprintf_P(temp_buf, PSTR(" status: %4x "), status); SERIAL_ECHO(temp_buf); print_bin(status); #endif - const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; SERIAL_ECHOPGM("\n...OUTPUT: "); serialprintPGM(status & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); SERIAL_ECHOPGM(" BUSY: "); echo_yes_no(!(status & STATUS_BUSY)); SERIAL_ECHOPGM(" DIR: "); - serialprintPGM((((status & STATUS_DIR) >> 4) ^ L64helper.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); + serialprintPGM((((status & STATUS_DIR) >> 4) ^ L64xx_MARLIN.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); SERIAL_ECHOPGM(" Last Command: "); if (status & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("IN"); SERIAL_ECHOPGM("VALID "); @@ -72,10 +72,10 @@ void L6470_status_decode(const uint16_t status, const L6470_axis_t axis) { #endif inline void L6470_say_status(const L6470_axis_t axis) { - if (L64helper.spi_abort) return; - const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; - L64helper.get_status(axis); - L64helper.say_axis(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 "), sh.STATUS_AXIS_RAW); @@ -87,7 +87,7 @@ inline void L6470_say_status(const L6470_axis_t axis) { 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((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64helper.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 (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("IN"); SERIAL_ECHOPGM("VALID "); @@ -115,7 +115,7 @@ inline void L6470_say_status(const L6470_axis_t axis) { */ void GcodeSuite::M122() { - L64helper.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 (parser.seen('S')) // tmc_set_report_interval(parser.value_bool()); @@ -161,8 +161,8 @@ void GcodeSuite::M122() { L6470_say_status(E5); #endif - L64helper.spi_active = false; // done with all SPI transfers - clear handshake flags - L64helper.spi_abort = false; + L64xx_MARLIN.spi_active = false; // done with all SPI transfers - clear handshake flags + L64xx_MARLIN.spi_abort = false; } #endif // HAS_L64XX diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index b5aa0dea182d..0938ceb64721 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -80,8 +80,8 @@ */ void L6470_report_current(L64XX &motor, const L6470_axis_t axis) { - if (L64helper.spi_abort) return; // don't do anything if set_directions() has occurred - const uint16_t status = L64helper.get_status(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, @@ -90,8 +90,8 @@ void L6470_report_current(L64XX &motor, const L6470_axis_t axis) { const float comp_coef = 1600.0f / L6470_ADC_out_limited; const int MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); char temp_buf[80]; - const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; - L64helper.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 "), sh.STATUS_AXIS_RAW); SERIAL_ECHO(temp_buf); @@ -229,7 +229,7 @@ void GcodeSuite::M906() { if (report_current) { #define L6470_REPORT_CURRENT(Q) L6470_report_current(stepper##Q, Q) - L64helper.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_IS_L64XX(X) L6470_REPORT_CURRENT(X); @@ -271,8 +271,8 @@ void GcodeSuite::M906() { L6470_REPORT_CURRENT(E5); #endif - L64helper.spi_active = false; // done with all SPI transfers - clear handshake flags - L64helper.spi_abort = false; + L64xx_MARLIN.spi_active = false; // done with all SPI transfers - clear handshake flags + L64xx_MARLIN.spi_abort = false; } } diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index be305830c675..31809cc4ca2b 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -61,7 +61,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPGM("M916"); - // Variables used by L64helper.get_user_input function - some may not be used + // 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]; @@ -77,7 +77,7 @@ void GcodeSuite::M916() { uint8_t j; // general purpose counter - if (L64helper.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 L6470_ECHOLNPAIR("feedrate = ", final_feedrate); @@ -85,13 +85,13 @@ void GcodeSuite::M916() { planner.synchronize(); // wait for all current movement commands to complete for (j = 0; j < driver_count; j++) - L64helper.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 L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; L6470_ECHOLNPGM(".\n."); @@ -100,7 +100,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPAIR("kval_hold = ", kval_hold); // set & report KVAL_HOLD for this run for (j = 0; j < driver_count; j++) - L64helper.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); @@ -115,7 +115,7 @@ void GcodeSuite::M916() { status_composite = 0; // clear out the old bits for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64helper.get_status(axis_index[j])) & sh.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] ; } @@ -123,7 +123,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } return; } @@ -139,7 +139,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPGM("has occurred"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } } else @@ -194,14 +194,14 @@ void GcodeSuite::M917() { uint8_t j; // general purpose counter - if (L64helper.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 L6470_ECHOLNPAIR("feedrate = ", final_feedrate); planner.synchronize(); // wait for all current movement commands to complete for (j = 0; j < driver_count; j++) - L64helper.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]; @@ -218,7 +218,7 @@ void GcodeSuite::M917() { L6470_ECHOPAIR(" (STALL_TH: ", STALL_TH_val); L6470_ECHOLNPGM(")"); - const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; do { @@ -236,7 +236,7 @@ void GcodeSuite::M917() { status_composite = 0; // clear out the old bits for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64helper.get_status(axis_index[j])) & sh.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]; } @@ -244,7 +244,7 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } return; } @@ -260,7 +260,7 @@ void GcodeSuite::M917() { L6470_EOL(); L6470_ECHOLNPAIR("Lowering KVAL_HOLD by about 5% to ", kval_hold); for (j = 0; j < driver_count; j++) - L64helper.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); + L64xx_MARLIN.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); } L6470_ECHOLNPGM("."); gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered @@ -268,7 +268,7 @@ void GcodeSuite::M917() { safe_delay(5000); status_composite_temp = 0; for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64helper.get_status(axis_index[j])) & sh.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]; } } @@ -410,10 +410,10 @@ void GcodeSuite::M917() { if (test_phase != 4) { for (j = 0; j < driver_count; j++) { // update threshold(s) - L64helper.set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val); - L64helper.set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val); - if (L64helper.get_param(axis_index[j], L6470_OCD_TH) != OCD_TH_val) L6470_ECHOLNPGM("OCD mismatch"); - if (L64helper.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) L6470_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) L6470_ECHOLNPGM("OCD mismatch"); + if (L64xx_MARLIN.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) L6470_ECHOLNPGM("STALL mismatch"); } } @@ -423,7 +423,7 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("Completed with errors"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } } else @@ -467,7 +467,7 @@ void GcodeSuite::M918() { uint8_t j; // general purpose counter - if (L64helper.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 +493,7 @@ void GcodeSuite::M918() { } for (j = 0; j < driver_count; j++) - L64helper.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 L6470_ECHOLNPAIR("target (maximum) feedrate = ",final_feedrate); @@ -503,7 +503,7 @@ void GcodeSuite::M918() { planner.synchronize(); // wait for all current movement commands to complete for (j = 0; j < driver_count; j++) - L64helper.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] = " "; temp_axis_string[0] = axis_mon[0][0]; // need to have a string for use within sprintf format section @@ -526,7 +526,7 @@ void GcodeSuite::M918() { planner.synchronize(); for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64helper.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 @@ -536,7 +536,7 @@ void GcodeSuite::M918() { L6470_ECHOLNPGM("Completed with errors"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } } else diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 4883e2b2b9da..64f2f60d1175 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -89,7 +89,7 @@ //#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{ \ - L64helper.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); \ diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index b1a2b71fac28..610b352f143b 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -30,17 +30,17 @@ #include "L6470_Marlin.h" -extern L6470_Marlin L64helper; +L64XX_Marlin L64xx_MARLIN; #include "../../module/stepper_indirection.h" #include "../../gcode/gcode.h" #include "../../module/planner.h" -const char * const L6470_Marlin::index_to_axis[MAX_L6470] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; +const char * const L64XX_Marlin::index_to_axis[MAX_L6470] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; -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 -bool L6470_Marlin::index_to_dir[MAX_L6470] = { INVERT_X_DIR , // 0 X +bool L64XX_Marlin::index_to_dir[MAX_L6470] = { INVERT_X_DIR , // 0 X INVERT_Y_DIR , // 1 Y INVERT_Z_DIR , // 2 Z #if ENABLED(X_DUAL_STEPPER_DRIVERS) @@ -63,10 +63,10 @@ bool L6470_Marlin::index_to_dir[MAX_L6470] = { INVERT_X_DIR INVERT_E5_DIR //12 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; -L6470_Marlin::L64XX_shadow_t L6470_Marlin::shadow; +L64XX_Marlin::L64XX_shadow_t L64XX_Marlin::shadow; //uint32_t UVLO_ADC = 0x0400; // ADC undervoltage event @@ -115,7 +115,7 @@ void L6470_populate_chain_array() { #endif } -void L6470_Marlin::init() { // Set up SPI and then init chips +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); @@ -124,6 +124,13 @@ void L6470_Marlin::init() { // Set up SPI and then init chips #endif 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 @@ -137,7 +144,7 @@ void L6470_Marlin::init() { // Set up SPI and then init chips * 3. copy status layout * 4. make all error bits active low (if needed) */ -uint16_t L6470_Marlin::get_stepper_status(L64XX &st) { +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; @@ -163,7 +170,7 @@ uint16_t L6470_Marlin::get_stepper_status(L64XX &st) { return shadow.STATUS_AXIS; } -uint16_t L6470_Marlin::get_status(const L6470_axis_t axis) { +uint16_t L64XX_Marlin::get_status(const L6470_axis_t axis) { #define STATUS_L6470(Q) get_stepper_status(stepper##Q) @@ -213,7 +220,7 @@ uint16_t L6470_Marlin::get_status(const L6470_axis_t axis) { return 0; // Not needed but kills a compiler warning } -uint32_t L6470_Marlin::get_param(const L6470_axis_t axis, const 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) @@ -263,7 +270,7 @@ uint32_t L6470_Marlin::get_param(const L6470_axis_t axis, const uint8_t param) { return 0 ; // not needed but kills a compiler warning } -void L6470_Marlin::set_param(const L6470_axis_t axis, const uint8_t param, const 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) @@ -325,7 +332,7 @@ inline void err_out_of_bounds() { L6470_ECHOLNPGM("ERROR - motion out of bounds"); } -bool L6470_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char axis_mon[3][3], +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 ) { @@ -564,7 +571,7 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index #endif /* -char* L6470_Marlin::index_to_axis(const uint8_t index) { +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"), @@ -574,7 +581,7 @@ char* L6470_Marlin::index_to_axis(const uint8_t index) { } */ -void L6470_Marlin::say_axis(const L6470_axis_t axis, const bool label/*=true*/) { +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(' '); @@ -583,10 +590,10 @@ void L6470_Marlin::say_axis(const L6470_axis_t axis, const bool label/*=true*/) SERIAL_CHAR(' '); } -void L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t axis) { // assumes status bits have been inverted +void L64XX_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t axis) { // assumes status bits have been inverted #if ENABLED(L6470_CHITCHAT) char temp_buf[10]; - L64helper.say_axis(axis); + L64xx_MARLIN.say_axis(axis); sprintf_P(temp_buf, PSTR(" %4x "), status); L6470_ECHO(temp_buf); print_bin(status); @@ -663,7 +670,7 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t }; inline void append_stepper_err(char * &p, const uint8_t stepper_index) { - const char * const str = L64helper.index_to_axis[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; @@ -674,7 +681,7 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t if (err) p += sprintf_P(p, err, NULL); } - void L6470_Marlin::monitor_update(uint8_t stepper_index, uint16_t status) { + 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]; @@ -776,7 +783,7 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t } // 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; diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index dcfebb71ea74..531114fcc4c1 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -53,9 +53,11 @@ #define dSPIN_STEP_CLOCK_REV dSPIN_STEP_CLOCK+1 #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)) +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 L6470_Marlin : public L64XXHelper { +class L64XX_Marlin { public: static const char * const index_to_axis[MAX_L6470]; @@ -66,7 +68,7 @@ class L6470_Marlin : public L64XXHelper { static volatile bool spi_abort; static bool spi_active; - L6470_Marlin() { L64XX::set_helper(this); } + L64XX_Marlin() {} static void init(); static void init_to_defaults(); @@ -121,13 +123,11 @@ class L6470_Marlin : public L64XXHelper { static L64XX_shadow_t shadow; - //static uint32_t UVLO_ADC; // ADC undervoltage event - -protected: - // L64XXHelper methods +//protected: static void spi_init(); - static uint8_t transfer(uint8_t data, int16_t ss_pin); - static uint8_t transfer(uint8_t data, int16_t ss_pin, uint8_t chain_position); + 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); + }; -extern L6470_Marlin L64helper; +extern L64XX_Marlin L64xx_MARLIN; diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 6cadb07ed6bf..e29d7eeda265 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -408,22 +408,22 @@ void Stepper::set_directions() { #if HAS_L64XX if (L64XX_OK_to_power_up) { // OK to send the direction commands (which powers up the L64XX steppers) - if (L64helper.spi_active) { - L64helper.spi_abort = true; // Interrupted a SPI transfer - need to shut it down gracefully + 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 - L64helper.transfer(L6470_buf, L64XX::chain[0]); // Send enough NOOPs to complete any command - L64helper.transfer(L6470_buf, L64XX::chain[0]); - L64helper.transfer(L6470_buf, L64XX::chain[0]); + 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]); } - // L64helper.dir_commands[] is an array that holds direction command for each stepper + // L64xx_MARLIN.dir_commands[] is an array that holds direction command for each stepper - // Scan command array, copy matches into L64helper.transfer + // Scan command array, copy matches into L64xx_MARLIN.transfer for (uint8_t j = 1; j <= L64XX::chain[0]; j++) - L6470_buf[j] = L64helper.dir_commands[L64XX::chain[j]]; + L6470_buf[j] = L64xx_MARLIN.dir_commands[L64XX::chain[j]]; - L64helper.transfer(L6470_buf, L64XX::chain[0]); // send the command stream to the drivers + L64xx_MARLIN.transfer(L6470_buf, L64XX::chain[0]); // send the command stream to the drivers } #endif diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper_indirection.cpp index 6c76759c6b0b..bd57cc52b6e8 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper_indirection.cpp @@ -915,7 +915,7 @@ void reset_stepper_drivers() { #endif #if HAS_L64XX - L64helper.init_to_defaults(); + L64xx_MARLIN.init_to_defaults(); #endif #if HAS_TRINAMIC @@ -1068,6 +1068,7 @@ void reset_stepper_drivers() { // briefly sends power to the steppers 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); @@ -1108,7 +1109,7 @@ void reset_stepper_drivers() { #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() { + void L64XX_Marlin::init_to_defaults() { #if AXIS_IS_L64XX(X) L6470_INIT_CHIP(X); #endif diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h index e50b091e4231..e487b8723e67 100644 --- a/Marlin/src/module/stepper_indirection.h +++ b/Marlin/src/module/stepper_indirection.h @@ -84,7 +84,7 @@ // L6470 has STEP on normal pins, but DIR/ENABLE via SPI #if HAS_L64XX #include "../libs/L6470/L6470_Marlin.h" - #define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L64helper.dir_commands[Q] = (STATE ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0) + #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 From 30b276815d0f6a2c8ab08a3c7005a456092e0e78 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Thu, 24 Jan 2019 22:55:45 -0600 Subject: [PATCH 12/23] Support powerSTEP01, L6480 (L64XX v0.7.0) --- Marlin/Configuration.h | 11 +- Marlin/Configuration_adv.h | 217 ++++---- Marlin/src/HAL/HAL_LINUX/include/serial.h | 2 + Marlin/src/HAL/shared/HAL_spi_L6470.cpp | 80 +-- Marlin/src/Marlin.cpp | 8 +- Marlin/src/Marlin.h | 47 +- Marlin/src/core/drivers.h | 190 +++++++ Marlin/src/core/enum.h | 4 - Marlin/src/gcode/calibrate/G28.cpp | 17 +- Marlin/src/gcode/feature/L6470/M122.cpp | 138 ++++-- Marlin/src/gcode/feature/L6470/M906.cpp | 134 ++--- Marlin/src/gcode/feature/L6470/M916-918.cpp | 158 +++--- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/host/M114.cpp | 54 +- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/libs/L6470/L6470_Marlin.cpp | 519 +++++++++++--------- Marlin/src/libs/L6470/L6470_Marlin.h | 81 ++- Marlin/src/module/stepper.cpp | 74 +-- Marlin/src/module/stepper_indirection.cpp | 181 +++---- Marlin/src/module/stepper_indirection.h | 401 +++++++-------- buildroot/share/tests/megaatmega2560-tests | 5 + config/default/Configuration.h | 11 +- config/default/Configuration_adv.h | 217 ++++---- platformio.ini | 2 +- 25 files changed, 1454 insertions(+), 1103 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bd67939356b5..c6a8ca57b6eb 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 c26c9af3f3ce..7de54a9d9bae 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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..df6c02f1579b 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. + * L64XXHelper methods for SPI init and transfer */ +void L6470_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 L6470_Marlin::transfer(uint8_t data, int16_t ss_pin) { // first device in chain has data sent last extDigitalWrite(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); return data_out; } -void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) { +uint8_t L6470_Marlin::transfer(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) && !L64helper.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 L6470_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 badda0fd23a9..d27c2f7df41d 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -168,7 +168,7 @@ #include "lcd/extensible_ui/ui_api.h" #endif -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "libs/L6470/L6470_Marlin.h" #endif @@ -635,7 +635,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - L6470.monitor_driver(); + L64helper.monitor_driver(); #endif // Limit check_axes_activity frequency to 10Hz @@ -839,8 +839,8 @@ void setup() { HAL_init(); #endif - #if HAS_DRIVER(L6470) - L6470.init(); // setup SPI and then init chips + #if HAS_L64XX + L64helper.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 25fe2245f6e5..abb72127ce0b 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 @@ -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 fc5b5fedb7b1..75ba6d177edd 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -45,7 +45,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 @@ -455,11 +455,18 @@ void GcodeSuite::G28(const bool always_home_all) { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G28"); #endif - #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]; + L64helper.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..2b1d5ac30153 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,86 +30,138 @@ 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); +#if 0 + +void L6470_status_decode(const uint16_t status, const L6470_axis_t axis) { + if (Marlin_L6470.spi_abort) return; // don't do anything if set_directions() has occurred + if (L64helper.spi_abort) return; // don't do anything if set_directions() has occurred + L64helper.say_axis(axis); #if ENABLED(L6470_CHITCHAT) char temp_buf[20]; sprintf_P(temp_buf, PSTR(" status: %4x "), status); SERIAL_ECHO(temp_buf); print_bin(status); #endif + const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; SERIAL_ECHOPGM("\n...OUTPUT: "); serialprintPGM(status & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); SERIAL_ECHOPGM(" BUSY: "); echo_yes_no(!(status & STATUS_BUSY)); SERIAL_ECHOPGM(" DIR: "); - serialprintPGM((((status & STATUS_DIR) >> 4) ^ L6470.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); + serialprintPGM((((status & STATUS_DIR) >> 4) ^ L64helper.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); SERIAL_ECHOPGM(" Last Command: "); - if (status & STATUS_WRONG_CMD) SERIAL_ECHOPGM("IN"); + if (status & 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(status & sh.STATUS_AXIS_NOTPERF_CMD ? PSTR("Not PERFORMED") : PSTR("COMPLETED ")); + SERIAL_ECHOPAIR("\n...THERMAL: ", !(status & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(status & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK "); + } + else switch ((status & (sh.STATUS_AXIS_TH_SD | sh.STATUS_AXIS_TH_WRN)) >> 11) { + case 0: SERIAL_ECHOPGM("\n...THERMAL: DEVICE SHUTDOWN"); break; // these bits were inverted to make them active low + case 1: SERIAL_ECHOPGM("\n...THERMAL: BRIDGE SHUTDOWN"); break; + case 2: SERIAL_ECHOPGM("\n...THERMAL: WARNING "); break; + case 3: SERIAL_ECHOPGM("\n...THERMAL: OK "); break; + } + SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no(!(status & sh.STATUS_AXIS_OCD)); + SERIAL_ECHOPGM(" STALL:"); echo_yes_no(!(status & sh.STATUS_AXIS_STEP_LOSS_A) || !(status & sh.STATUS_AXIS_STEP_LOSS_B)); + SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no(status & sh.STATUS_AXIS_SCK_MOD); SERIAL_EOL(); } +#define L6470_STATUS_DECODE(Q) L6470_status_decode(stepper##Q.getStatus(), Q) + +#endif + +inline void L6470_say_status(const L6470_axis_t axis) { + if (L64helper.spi_abort) return; + const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + L64helper.get_status(axis); + L64helper.say_axis(axis); + #if ENABLED(L6470_CHITCHAT) + char temp_buf[20]; + sprintf_P(temp_buf, PSTR(" status: %4x "), sh.STATUS_AXIS_RAW); + SERIAL_ECHO(temp_buf); + print_bin(sh.STATUS_AXIS_RAW); + serialprintPGM(sh.STATUS_AXIS_LAYOUT ? PSTR(" L6470") : PSTR(" L6480/powerSTEP01")); + #endif + SERIAL_ECHOPGM("\n...OUTPUT: "); + 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((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64helper.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); + SERIAL_ECHOPGM(" Last Command: "); + if (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("IN"); + SERIAL_ECHOPGM("VALID "); + 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_ECHOLNPGM(" STEP-CLOCK MODE:"); echo_yes_no(sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD); +} + /** * M122: Debug L6470 drivers */ 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) + L64helper.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; + L64helper.spi_active = false; // done with all SPI transfers - clear handshake flags + L64helper.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 f13b205cb6c9..2faaf3d8b395 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" @@ -79,42 +79,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 (L64helper.spi_abort) return; // don't do anything if set_directions() has occurred + const uint16_t status = L64helper.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 L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + L64helper.say_axis(axis); #if ENABLED(L6470_CHITCHAT) - 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); + 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)); @@ -129,6 +129,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)) { + 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() { @@ -138,7 +158,7 @@ void GcodeSuite::M906() { bool report_current = true; - #if HAS_DRIVER(L6470) + #if HAS_L64XX const uint8_t index = parser.byteval('I'); #endif @@ -153,29 +173,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; @@ -183,22 +203,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 } @@ -209,51 +229,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 + L64helper.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; + L64helper.spi_active = false; // done with all SPI transfers - clear handshake flags + L64helper.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 1ec60363a727..1605f0577e90 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" @@ -61,23 +61,23 @@ void GcodeSuite::M916() { L6470_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 L64helper.get_user_input function - some may not be used + char *axis_mon[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 (L64helper.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 L6470_ECHOLNPAIR("feedrate = ", final_feedrate); @@ -85,12 +85,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 + L64helper.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 L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; L6470_ECHOLNPGM(".\n."); @@ -99,7 +100,7 @@ void GcodeSuite::M916() { L6470_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); + L64helper.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); @@ -114,31 +115,31 @@ 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] = (~L64helper.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)) { L6470_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } 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) L6470_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))) { L6470_ECHOLNPGM("has occurred"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } } else @@ -178,29 +179,29 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("M917"); - char axis_mon[3][3] = { " ", " ", " " }; // list of axes to be monitored - uint8_t axis_index[3]; + char *axis_mon[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 (L64helper.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 L6470_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 + L64helper.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]; @@ -211,16 +212,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 - L6470_ECHOPAIR(".\n.\n.\nover_current threshold : ", (ocd_th_val + 1) * 375); // first status display - L6470_ECHOPAIR(" (OCD_TH: : ", ocd_th_val); - L6470_ECHOPAIR(") Stall threshold: ", (stall_th_val + 1) * 31.25); - L6470_ECHOPAIR(" (STALL_TH: ", stall_th_val); + L6470_ECHOPAIR(".\n.\n.\nover_current threshold : ", (OCD_TH_val + 1) * 375); // first status display + L6470_ECHOPAIR(" (OCD_TH: : ", OCD_TH_val); + L6470_ECHOPAIR(") Stall threshold: ", (STALL_TH_val + 1) * 31.25); + L6470_ECHOPAIR(" (STALL_TH: ", STALL_TH_val); L6470_ECHOLNPGM(")"); + const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + do { - L6470_ECHOPAIR("STALL threshold : ", (stall_th_val + 1) * 31.25); - L6470_ECHOLNPAIR(" OCD threshold : ", (ocd_th_val + 1) * 375); + L6470_ECHOPAIR("STALL threshold : ", (STALL_TH_val + 1) * 31.25); + L6470_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); @@ -233,20 +236,20 @@ 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] = (~L64helper.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)) { L6470_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } return; } - if (status_composite & (STATUS_TH_WRN | STATUS_TH_SD)) { + if (status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) { L6470_ECHOLNPGM("thermal problem - waiting for chip(s) to cool down "); uint16_t status_composite_temp = 0; uint8_t k = 0; @@ -257,7 +260,7 @@ void GcodeSuite::M917() { L6470_EOL(); L6470_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); + L64helper.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); } L6470_ECHOLNPGM("."); gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered @@ -265,33 +268,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] = (~L64helper.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)); + while (status_composite_temp & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)); L6470_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 L6470_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 L6470_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 L6470_ECHOLNPGM("LOGIC E0C - dec OCD"); } else { @@ -302,15 +305,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 L6470_ECHOLNPGM("LOGIC E1A - OCD at max - go to 2"); } else { - ocd_th_val++; // try a higher value + OCD_TH_val++; // try a higher value L6470_ECHOLNPGM("LOGIC E1B - inc OCD"); } } @@ -321,23 +324,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 >= sh.AXIS_STALL_TH_MAX) { + STALL_TH_val = sh.AXIS_STALL_TH_MAX; // limit to max L6470_ECHOLNPGM("LOGIC E2A - STALL warning, STALL at max, quit"); L6470_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 L6470_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 L6470_ECHOLNPGM("LOGIC E2C - no STALL, dec STALL"); } else { @@ -349,16 +352,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 >= sh.AXIS_STALL_TH_MAX) { + STALL_TH_val = sh.AXIS_STALL_TH_MAX; // limit to max L6470_ECHOLNPGM("finished - STALL at maximum value but still have stall warning"); test_phase = 4; L6470_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 L6470_ECHOLNPGM("LOGIC E3B - STALL, inc stall"); } } @@ -375,8 +378,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 L6470_ECHOLNPGM("LOGIC N0A - DEC OCD"); } else { @@ -388,8 +391,8 @@ void GcodeSuite::M917() { case 1: L6470_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) L6470_ECHOLNPGM("LOGIC N2B - dec STALL"); } else { @@ -407,10 +410,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) L6470_ECHOLNPGM("OCD mismatch"); - if (L6470.get_param(axis_index[j], L6470_STALL_TH) != stall_th_val) L6470_ECHOLNPGM("STALL mismatch"); + L64helper.set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val); + L64helper.set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val); + if (L64helper.get_param(axis_index[j], L6470_OCD_TH) != OCD_TH_val) L6470_ECHOLNPGM("OCD mismatch"); + if (L64helper.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) L6470_ECHOLNPGM("STALL mismatch"); } } @@ -420,7 +423,7 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("Completed with errors"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } } else @@ -450,21 +453,21 @@ void GcodeSuite::M918() { L6470_ECHOLNPGM("M918"); - char axis_mon[3][3] = { " ", " ", " " }; // List of axes to monitor - uint8_t axis_index[3]; + char *axis_mon[3] = { " ", " ", " " }; // List of axes to monitor + 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; 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 (L64helper.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'); @@ -490,7 +493,7 @@ void GcodeSuite::M918() { } for (j = 0; j < driver_count; j++) - L6470.set_param(axis_index[j], L6470_STEP_MODE, m_bits); // set microsteps + L64helper.set_param(axis_index[j], L6470_STEP_MODE, m_bits); // set microsteps L6470_ECHOLNPAIR("target (maximum) feedrate = ",final_feedrate); @@ -500,11 +503,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 + L64helper.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; @@ -523,7 +526,7 @@ 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] = (~L64helper.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 @@ -533,12 +536,11 @@ void GcodeSuite::M918() { L6470_ECHOLNPGM("Completed with errors"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); + L64helper.error_status_decode(axis_status[j], axis_index[j]); } } else L6470_ECHOLNPGM("Completed with 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 01186b626f4b..0b2cca491aae 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 2a64e0b678d9..0aa66b7f82b1 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 ffb5f56de739..4883e2b2b9da 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" #endif void report_xyze(const float pos[], const uint8_t n = 4, const uint8_t precision = 3) { @@ -85,61 +83,61 @@ 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); \ - 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); \ - L6470_ECHO(temp_buf); \ - }while(0) - - L6470_ECHOPGM("\nL6470:"); - #if AXIS_DRIVER_TYPE_X(L6470) + #define REPORT_ABSOLUTE_POS(Q) do{ \ + L64helper.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); \ + L6470_ECHO(temp_buf); \ + }while(0) + + L6470_ECHOPGM("\nL64XX:"); + #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 f0ddefb74f6b..4a43a1cb7a3c 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1687,7 +1687,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 (ENABLED(G29_RETRY_AND_RECOVER) || ENABLED(GCODE_MACROS) || ENABLED(POWER_LOSS_RECOVERY) || HAS_DRIVER(L6470)) +#define USE_EXECUTE_COMMANDS_IMMEDIATE (ENABLED(G29_RETRY_AND_RECOVER) || ENABLED(GCODE_MACROS) || ENABLED(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 927063564b55..f886bf263ac9 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -26,261 +26,284 @@ #include "../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "L6470_Marlin.h" -L6470_Marlin L6470; +extern L6470_Marlin L64helper; -#include "../stepper_indirection.h" +#include "../../module/stepper_indirection.h" #include "../../gcode/gcode.h" -#include "../planner.h" +#include "../../module/planner.h" + +const char * const L6470_Marlin::index_to_axis[MAX_L6470] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; uint8_t L6470_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" }; - -bool L6470_Marlin::index_to_dir[MAX_L6470] = { - INVERT_X_DIR , // 0 X - INVERT_Y_DIR , // 1 Y - INVERT_Z_DIR , // 2 Z - #if ENABLED(X_DUAL_STEPPER_DRIVERS) - INVERT_X_DIR ^ INVERT_X2_VS_X_DIR , // 3 X2 - #else - INVERT_X_DIR , // 3 X2 - #endif - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - INVERT_Y_DIR ^ INVERT_Y2_VS_Y_DIR , // 4 Y2 - #else - INVERT_Y_DIR , // 4 Y2 - #endif - INVERT_Z_DIR , // 5 Z2 - INVERT_Z_DIR , // 6 Z3 - INVERT_E0_DIR , // 7 E0 - INVERT_E1_DIR , // 8 E1 - INVERT_E2_DIR , // 9 E2 - INVERT_E3_DIR , //10 E3 - INVERT_E4_DIR , //11 E4 - INVERT_E5_DIR , //12 E5 -}; - -uint8_t L6470_Marlin::axis_xref[MAX_L6470] = { - AxisEnum(X_AXIS), // X - AxisEnum(Y_AXIS), // Y - AxisEnum(Z_AXIS), // Z - AxisEnum(X_AXIS), // X2 - AxisEnum(Y_AXIS), // Y2 - AxisEnum(Z_AXIS), // Z2 - AxisEnum(Z_AXIS), // Z3 - AxisEnum(E_AXIS), // E0 - AxisEnum(E_AXIS), // E1 - AxisEnum(E_AXIS), // E2 - AxisEnum(E_AXIS), // E3 - AxisEnum(E_AXIS), // E4 - AxisEnum(E_AXIS) // E5 -}; +bool L6470_Marlin::index_to_dir[MAX_L6470] = { INVERT_X_DIR , // 0 X + INVERT_Y_DIR , // 1 Y + INVERT_Z_DIR , // 2 Z + #if ENABLED(X_DUAL_STEPPER_DRIVERS) + INVERT_X_DIR ^ INVERT_X2_VS_X_DIR , // 3 X2 + #else + INVERT_X_DIR , // 3 X2 + #endif + #if ENABLED(Y_DUAL_STEPPER_DRIVERS) + INVERT_Y_DIR ^ INVERT_Y2_VS_Y_DIR , // 4 Y2 + #else + INVERT_Y_DIR , // 4 Y2 + #endif + INVERT_Z_DIR , // 5 Z2 + INVERT_Z_DIR , // 6 Z3 + INVERT_E0_DIR , // 7 E0 + INVERT_E1_DIR , // 8 E1 + INVERT_E2_DIR , // 9 E2 + INVERT_E3_DIR , //10 E3 + INVERT_E4_DIR , //11 E4 + INVERT_E5_DIR //12 E5 + }; volatile bool L6470_Marlin::spi_abort = false; bool L6470_Marlin::spi_active = false; -void L6470_Marlin::populate_chain_array() { +L6470_Marlin::L64XX_shadow_t L6470_Marlin::shadow; + +//uint32_t UVLO_ADC = 0x0400; // ADC undervoltage event + +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 + #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 + + 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 L6470_Marlin::get_stepper_status(const 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 L6470_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); + #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 L6470_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); + #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 L6470_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); + #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 } } @@ -295,11 +318,13 @@ inline void echo_oct_used(const float &oct, const bool stall) { serialprintPGM(stall ? PSTR(" (Stall") : PSTR(" (OCD")); L6470_ECHOLNPGM(" threshold)"); } -inline void err_out_of_bounds() { L6470_ECHOLNPGM("ERROR - motion out of bounds"); } +inline void err_out_of_bounds() { + L6470_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 L6470_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char* axis_mon[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 @@ -317,16 +342,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 @@ -336,19 +364,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 @@ -364,8 +390,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 @@ -381,8 +407,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 @@ -398,8 +424,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; } @@ -409,8 +435,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; @@ -534,27 +560,39 @@ 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* L6470_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 L6470_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 L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t axis) { // assumes status bits have been inverted #if ENABLED(L6470_CHITCHAT) char temp_buf[10]; - say_axis(axis); + L64helper.say_axis(axis); sprintf_P(temp_buf, PSTR(" %4x "), status); L6470_ECHO(temp_buf); print_bin(status); L6470_ECHOPGM(" THERMAL: "); - serialprintPGM((status & STATUS_TH_SD) ? PSTR("SHUTDOWN") : (status & STATUS_TH_WRN) ? PSTR("WARNING ") : PSTR("OK ")); + serialprintPGM((status & shadow.STATUS_AXIS_TH_SD) ? PSTR("SHUTDOWN") : (status & shadow.STATUS_AXIS_TH_WRN) ? PSTR("WARNING ") : PSTR("OK ")); L6470_ECHOPGM(" OVERCURRENT: "); - echo_yes_no(status & STATUS_OCD); + echo_yes_no(status & shadow.STATUS_AXIS_OCD); L6470_ECHOPGM(" STALL: "); - echo_yes_no(status & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)); + echo_yes_no(status & (shadow.STATUS_AXIS_STEP_LOSS_A | shadow.STATUS_AXIS_STEP_LOSS_B)); L6470_EOL(); #else UNUSED(status); UNUSED(axis); @@ -567,7 +605,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; @@ -580,59 +618,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 = L64helper.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; + } + + 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 L6470_monitor_update(uint8_t stepper_index, uint16_t status) { + void L6470_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; @@ -662,14 +707,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; @@ -682,7 +727,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); @@ -698,22 +743,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 @@ -724,13 +767,11 @@ 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() { static millis_t next_cOT = 0; @@ -739,43 +780,45 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis 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 @@ -790,4 +833,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 a29e40739e2e..eb1bc6cd11b6 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -49,46 +49,85 @@ #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 { +typedef enum : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 } L6470_axis_t; + +class L6470_Marlin : public L64XXHelper { public: + static const char * const index_to_axis[MAX_L6470]; + static bool index_to_dir[MAX_L6470]; - static uint8_t axis_xref[MAX_L6470]; - static char index_to_axis[MAX_L6470][3]; 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() {} + L6470_Marlin() { L64XX::set_helper(*this); } - 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(const 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], + 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 say_axis(const uint8_t axis, const bool label=true); + static void monitor_update(uint8_t stepper_index, uint16_t status); + + static void monitor_driver(); -private: - void populate_chain_array(); + 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); + + // ~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; + + //static uint32_t UVLO_ADC; // ADC undervoltage event + +protected: + // L64XXHelper methods + static void spi_init(); + static uint8_t transfer(uint8_t data, int16_t ss_pin); + static uint8_t transfer(uint8_t data, int16_t ss_pin, uint8_t chain_position); }; -extern L6470_Marlin L6470; +extern L6470_Marlin L64helper; diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index a5b86631f936..acd16949c63e 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) @@ -358,10 +360,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); \ @@ -408,25 +406,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 (L64helper.spi_active) { + L64helper.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 + L64helper.transfer(L6470_buf, L64XX::chain[0]); // Send enough NOOPs to complete any command + L64helper.transfer(L6470_buf, L64XX::chain[0]); + L64helper.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]]; + // L64helper.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 L64helper.transfer + for (uint8_t j = 1; j <= L64XX::chain[0]; j++) + L6470_buf[j] = L64helper.dir_commands[L64XX::chain[j]]; + L64helper.transfer(L6470_buf, L64XX::chain[0]); // send the command stream to the drivers + } #endif // A small delay may be needed after changing direction @@ -1806,22 +1804,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..27503aec43b5 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 + L64helper.init_to_defaults(); #endif #if HAS_TRINAMIC @@ -1022,117 +1022,130 @@ 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.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; + } + } + else { + st.SetParam(st.L64XX_CONFIG,(st.GetParam(st.L64XX_CONFIG) | PWR_VCC_7_5V)); + 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; + } + } + st.getStatus(); + st.getStatus(); + } + + #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); + #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 eafb0c6eef87..e50b091e4231 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{ L64helper.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 bfb405208ada..f921169d565c 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 bd67939356b5..c6a8ca57b6eb 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 c26c9af3f3ce..7de54a9d9bae 100644 --- a/config/default/Configuration_adv.h +++ b/config/default/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/platformio.ini b/platformio.ini index 5a1372d030db..61a5e0f9ff19 100644 --- a/platformio.ini +++ b/platformio.ini @@ -34,7 +34,7 @@ lib_deps = TMCStepper@<1.0.0 Adafruit NeoPixel@1.1.3 https://github.com/lincomatic/LiquidTWI2/archive/30aa480.zip - https://github.com/ameyer/Arduino-L6470/archive/dev.zip + https://github.com/ameyer/Arduino-L6470/archive/0.7.0.zip https://github.com/trinamic/TMC26XStepper/archive/c1921b4.zip https://github.com/mikeshub/SailfishLCD.git https://github.com/mikeshub/SailfishRGB_LED.git From e1c9f5a9b1d3331073487e4756f9d61158cdbcb7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Mar 2019 18:56:31 -0600 Subject: [PATCH 13/23] Update examples for L64XX 0.7.0 --- .../examples/3DFabXYZ/Migbot/Configuration.h | 11 +- .../3DFabXYZ/Migbot/Configuration_adv.h | 217 ++++++++++-------- .../AlephObjects/TAZ4/Configuration.h | 11 +- .../AlephObjects/TAZ4/Configuration_adv.h | 217 ++++++++++-------- .../AliExpress/CL-260/Configuration.h | 11 +- .../AliExpress/UM2pExt/Configuration.h | 11 +- .../AliExpress/UM2pExt/Configuration_adv.h | 217 ++++++++++-------- config/examples/Anet/A2/Configuration.h | 11 +- config/examples/Anet/A2/Configuration_adv.h | 217 ++++++++++-------- config/examples/Anet/A2plus/Configuration.h | 11 +- .../examples/Anet/A2plus/Configuration_adv.h | 217 ++++++++++-------- config/examples/Anet/A6/Configuration.h | 11 +- config/examples/Anet/A6/Configuration_adv.h | 217 ++++++++++-------- config/examples/Anet/A8/Configuration.h | 11 +- config/examples/Anet/A8/Configuration_adv.h | 217 ++++++++++-------- config/examples/AnyCubic/i3/Configuration.h | 11 +- .../examples/AnyCubic/i3/Configuration_adv.h | 217 ++++++++++-------- config/examples/ArmEd/Configuration.h | 11 +- config/examples/ArmEd/Configuration_adv.h | 217 ++++++++++-------- config/examples/Azteeg/X5GT/Configuration.h | 11 +- .../BIBO/TouchX/cyclops/Configuration.h | 11 +- .../BIBO/TouchX/cyclops/Configuration_adv.h | 217 ++++++++++-------- .../BIBO/TouchX/default/Configuration.h | 11 +- .../BIBO/TouchX/default/Configuration_adv.h | 217 ++++++++++-------- config/examples/BQ/Hephestos/Configuration.h | 11 +- .../examples/BQ/Hephestos/Configuration_adv.h | 217 ++++++++++-------- .../examples/BQ/Hephestos_2/Configuration.h | 11 +- .../BQ/Hephestos_2/Configuration_adv.h | 217 ++++++++++-------- config/examples/BQ/WITBOX/Configuration.h | 11 +- config/examples/BQ/WITBOX/Configuration_adv.h | 217 ++++++++++-------- config/examples/Cartesio/Configuration.h | 11 +- config/examples/Cartesio/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/CR-10/Configuration.h | 11 +- .../Creality/CR-10/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/CR-10S/Configuration.h | 11 +- .../Creality/CR-10S/Configuration_adv.h | 217 ++++++++++-------- .../Creality/CR-10_5S/Configuration.h | 11 +- .../Creality/CR-10_5S/Configuration_adv.h | 217 ++++++++++-------- .../Creality/CR-10mini/Configuration.h | 11 +- .../Creality/CR-10mini/Configuration_adv.h | 217 ++++++++++-------- config/examples/Creality/CR-8/Configuration.h | 11 +- .../Creality/CR-8/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/Ender-2/Configuration.h | 11 +- .../Creality/Ender-2/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/Ender-3/Configuration.h | 11 +- .../Creality/Ender-3/Configuration_adv.h | 217 ++++++++++-------- .../examples/Creality/Ender-4/Configuration.h | 11 +- .../Creality/Ender-4/Configuration_adv.h | 217 ++++++++++-------- config/examples/Einstart-S/Configuration.h | 11 +- .../examples/Einstart-S/Configuration_adv.h | 217 ++++++++++-------- config/examples/Felix/Configuration.h | 11 +- config/examples/Felix/Configuration_adv.h | 217 ++++++++++-------- config/examples/Felix/DUAL/Configuration.h | 11 +- .../FlashForge/CreatorPro/Configuration.h | 11 +- .../FlashForge/CreatorPro/Configuration_adv.h | 217 ++++++++++-------- .../FolgerTech/i3-2020/Configuration.h | 11 +- .../FolgerTech/i3-2020/Configuration_adv.h | 217 ++++++++++-------- .../examples/Formbot/Raptor/Configuration.h | 11 +- .../Formbot/Raptor/Configuration_adv.h | 217 ++++++++++-------- .../examples/Formbot/T_Rex_2+/Configuration.h | 11 +- .../Formbot/T_Rex_2+/Configuration_adv.h | 217 ++++++++++-------- .../examples/Formbot/T_Rex_3/Configuration.h | 11 +- .../Formbot/T_Rex_3/Configuration_adv.h | 217 ++++++++++-------- config/examples/Geeetech/A10M/Configuration.h | 11 +- .../Geeetech/A10M/Configuration_adv.h | 217 ++++++++++-------- config/examples/Geeetech/A20M/Configuration.h | 11 +- .../Geeetech/A20M/Configuration_adv.h | 217 ++++++++++-------- .../examples/Geeetech/GT2560/Configuration.h | 11 +- .../Geeetech/I3_Pro_X-GT2560/Configuration.h | 11 +- .../Geeetech/MeCreator2/Configuration.h | 11 +- .../Geeetech/MeCreator2/Configuration_adv.h | 217 ++++++++++-------- .../Prusa i3 Pro B/bltouch/Configuration.h | 11 +- .../Prusa i3 Pro B/noprobe/Configuration.h | 11 +- .../Geeetech/Prusa i3 Pro C/Configuration.h | 11 +- .../Prusa i3 Pro C/Configuration_adv.h | 217 ++++++++++-------- .../Geeetech/Prusa i3 Pro W/Configuration.h | 11 +- .../Prusa i3 Pro W/Configuration_adv.h | 217 ++++++++++-------- .../examples/Infitary/i3-M508/Configuration.h | 11 +- .../Infitary/i3-M508/Configuration_adv.h | 217 ++++++++++-------- config/examples/JGAurora/A5/Configuration.h | 11 +- .../examples/JGAurora/A5/Configuration_adv.h | 217 ++++++++++-------- config/examples/MakerParts/Configuration.h | 11 +- .../examples/MakerParts/Configuration_adv.h | 217 ++++++++++-------- config/examples/Malyan/M150/Configuration.h | 11 +- .../examples/Malyan/M150/Configuration_adv.h | 217 ++++++++++-------- config/examples/Malyan/M200/Configuration.h | 11 +- .../examples/Malyan/M200/Configuration_adv.h | 217 ++++++++++-------- .../Micromake/C1/basic/Configuration.h | 11 +- .../Micromake/C1/enhanced/Configuration.h | 11 +- .../Micromake/C1/enhanced/Configuration_adv.h | 217 ++++++++++-------- config/examples/Mks/Robin/Configuration.h | 11 +- config/examples/Mks/Robin/Configuration_adv.h | 217 ++++++++++-------- config/examples/Mks/Sbase/Configuration.h | 11 +- config/examples/Mks/Sbase/Configuration_adv.h | 217 ++++++++++-------- .../Printrbot/PrintrboardG2/Configuration.h | 11 +- .../examples/RapideLite/RL200/Configuration.h | 11 +- .../RapideLite/RL200/Configuration_adv.h | 217 ++++++++++-------- .../examples/RepRapPro/Huxley/Configuration.h | 11 +- .../RepRapWorld/Megatronics/Configuration.h | 11 +- config/examples/RigidBot/Configuration.h | 11 +- config/examples/RigidBot/Configuration_adv.h | 217 ++++++++++-------- config/examples/SCARA/Configuration.h | 11 +- config/examples/SCARA/Configuration_adv.h | 217 ++++++++++-------- config/examples/STM32F10/Configuration.h | 11 +- config/examples/STM32F4/Configuration.h | 11 +- config/examples/Sanguinololu/Configuration.h | 11 +- .../examples/Sanguinololu/Configuration_adv.h | 217 ++++++++++-------- config/examples/TheBorg/Configuration.h | 11 +- config/examples/TheBorg/Configuration_adv.h | 217 ++++++++++-------- config/examples/TinyBoy2/Configuration.h | 11 +- config/examples/TinyBoy2/Configuration_adv.h | 217 ++++++++++-------- config/examples/Tronxy/X1/Configuration.h | 11 +- config/examples/Tronxy/X3A/Configuration.h | 11 +- .../examples/Tronxy/X3A/Configuration_adv.h | 217 ++++++++++-------- config/examples/Tronxy/X5S-2E/Configuration.h | 11 +- .../Tronxy/X5S-2E/Configuration_adv.h | 217 ++++++++++-------- config/examples/Tronxy/X5S/Configuration.h | 11 +- config/examples/Tronxy/XY100/Configuration.h | 11 +- .../UltiMachine/Archim1/Configuration.h | 11 +- .../UltiMachine/Archim1/Configuration_adv.h | 217 ++++++++++-------- .../UltiMachine/Archim2/Configuration.h | 11 +- .../UltiMachine/Archim2/Configuration_adv.h | 217 ++++++++++-------- config/examples/VORONDesign/Configuration.h | 11 +- .../examples/VORONDesign/Configuration_adv.h | 217 ++++++++++-------- .../examples/Velleman/K8200/Configuration.h | 11 +- .../Velleman/K8200/Configuration_adv.h | 217 ++++++++++-------- .../examples/Velleman/K8400/Configuration.h | 11 +- .../Velleman/K8400/Configuration_adv.h | 217 ++++++++++-------- .../Velleman/K8400/Dual-head/Configuration.h | 11 +- .../examples/WASP/PowerWASP/Configuration.h | 11 +- .../WASP/PowerWASP/Configuration_adv.h | 217 ++++++++++-------- .../Wanhao/Duplicator 6/Configuration.h | 11 +- .../Wanhao/Duplicator 6/Configuration_adv.h | 217 ++++++++++-------- .../examples/adafruit/ST7565/Configuration.h | 11 +- .../delta/Anycubic/Kossel/Configuration.h | 11 +- .../delta/Anycubic/Kossel/Configuration_adv.h | 217 ++++++++++-------- .../FLSUN/auto_calibrate/Configuration.h | 11 +- .../FLSUN/auto_calibrate/Configuration_adv.h | 217 ++++++++++-------- .../delta/FLSUN/kossel/Configuration.h | 11 +- .../delta/FLSUN/kossel/Configuration_adv.h | 217 ++++++++++-------- .../delta/FLSUN/kossel_mini/Configuration.h | 11 +- .../FLSUN/kossel_mini/Configuration_adv.h | 217 ++++++++++-------- .../Geeetech/Rostock 301/Configuration.h | 11 +- .../Geeetech/Rostock 301/Configuration_adv.h | 217 ++++++++++-------- .../delta/Hatchbox_Alpha/Configuration.h | 11 +- .../examples/delta/MKS/SBASE/Configuration.h | 11 +- .../delta/MKS/SBASE/Configuration_adv.h | 217 ++++++++++-------- .../delta/Tevo Little Monster/Configuration.h | 11 +- .../Tevo Little Monster/Configuration_adv.h | 217 ++++++++++-------- config/examples/delta/generic/Configuration.h | 11 +- .../delta/generic/Configuration_adv.h | 217 ++++++++++-------- .../delta/kossel_mini/Configuration.h | 11 +- .../delta/kossel_mini/Configuration_adv.h | 217 ++++++++++-------- .../examples/delta/kossel_pro/Configuration.h | 11 +- .../examples/delta/kossel_xl/Configuration.h | 11 +- .../delta/kossel_xl/Configuration_adv.h | 217 ++++++++++-------- .../examples/gCreate/gMax1.5+/Configuration.h | 11 +- .../gCreate/gMax1.5+/Configuration_adv.h | 217 ++++++++++-------- config/examples/makibox/Configuration.h | 11 +- config/examples/makibox/Configuration_adv.h | 217 ++++++++++-------- config/examples/stm32f103ret6/Configuration.h | 11 +- config/examples/tvrrug/Round2/Configuration.h | 11 +- .../tvrrug/Round2/Configuration_adv.h | 217 ++++++++++-------- config/examples/wt150/Configuration.h | 11 +- config/examples/wt150/Configuration_adv.h | 217 ++++++++++-------- 165 files changed, 8745 insertions(+), 7902 deletions(-) diff --git a/config/examples/3DFabXYZ/Migbot/Configuration.h b/config/examples/3DFabXYZ/Migbot/Configuration.h index a97d186a2214..f8afacbfddeb 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 a544fef95621..c35d8e79f6a2 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 99567bc800dd..8be90ffae202 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 4ffef15bc49f..b05f54cd6659 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 8611261b8bf2..5589c6a2cc20 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 fcdcbe081854..3fe77b5d5fe1 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 7bc37708fd22..3016b505ddea 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration_adv.h +++ b/config/examples/AliExpress/UM2pExt/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 b0b327d63d6b..6432ee512759 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 ebc0399ce4d1..7de6822dcbc7 100644 --- a/config/examples/Anet/A2/Configuration_adv.h +++ b/config/examples/Anet/A2/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 866ddcc48933..e07c24aef092 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 ebc0399ce4d1..7de6822dcbc7 100644 --- a/config/examples/Anet/A2plus/Configuration_adv.h +++ b/config/examples/Anet/A2plus/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 1024d9b92ef8..5b27255b2bf0 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 859508f6eaaf..e41bb130f6cb 100644 --- a/config/examples/Anet/A6/Configuration_adv.h +++ b/config/examples/Anet/A6/Configuration_adv.h @@ -1672,12 +1672,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 @@ -1687,112 +1687,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 /** @@ -1818,7 +1831,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 959e0652fce7..44ebcfb99b55 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 c4ebb98c435b..47a8a9c1e215 100644 --- a/config/examples/Anet/A8/Configuration_adv.h +++ b/config/examples/Anet/A8/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 2df15008f654..20199c678c0a 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 0361ec9ba990..636b7fd7b8e0 100644 --- a/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/config/examples/AnyCubic/i3/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 f3cd046773d8..7b0d505f6425 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 7a85c98acfa5..be7f9af2ad9d 100644 --- a/config/examples/ArmEd/Configuration_adv.h +++ b/config/examples/ArmEd/Configuration_adv.h @@ -1677,12 +1677,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 @@ -1692,112 +1692,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 /** @@ -1823,7 +1836,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 df37346b3870..e515a1ebfbb5 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 08a1a83f104b..31516c38acd8 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 edf15fb8b3cb..13a7ad715453 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 ab23313abb04..356a4cf7026e 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 b72c71bcbf3e..dbe4ef431c40 100644 --- a/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 cbe651775b77..a478785a9c02 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 3f71255a35ef..94e8464423fd 100644 --- a/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/config/examples/BQ/Hephestos/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 3fcfb44ccd1b..89b2bed4bdeb 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 ed48f2274fe5..51d8beb53f3e 100644 --- a/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/config/examples/BQ/Hephestos_2/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/BQ/WITBOX/Configuration.h b/config/examples/BQ/WITBOX/Configuration.h index a49f8b11666e..901cd7ab0f07 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 3f71255a35ef..94e8464423fd 100644 --- a/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/config/examples/BQ/WITBOX/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 d40d312df9c1..81a88fee0cec 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 3342e3eabe3d..63494580f025 100644 --- a/config/examples/Cartesio/Configuration_adv.h +++ b/config/examples/Cartesio/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 da13fee922e5..4d70e43ded66 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 6cb948980bc5..0305adce4c5f 100644 --- a/config/examples/Creality/CR-10/Configuration_adv.h +++ b/config/examples/Creality/CR-10/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 5da2cffb32e9..a42fe9f9dd2a 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 4be6ecf4ea78..c3f399217269 100644 --- a/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 8d447a38546e..14f9f4d2486a 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 9e1208ee51a8..7cb3fbf04c96 100644 --- a/config/examples/Creality/CR-10_5S/Configuration_adv.h +++ b/config/examples/Creality/CR-10_5S/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 aae4b8d1704c..134b294614b7 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 a446bc1ddee8..d9a0af4b6904 100644 --- a/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 0010f5a06684..4429a7526680 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 924ff26f15c6..a7b7bd982e8b 100644 --- a/config/examples/Creality/CR-8/Configuration_adv.h +++ b/config/examples/Creality/CR-8/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 154c9ce8c5a7..3feacdb8d8c6 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 6c7b7469b4ad..92fe00cf0612 100644 --- a/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/config/examples/Creality/Ender-2/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 ead6464b8c2f..0a4c369f3cac 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 5639b7911db7..2967ba05a573 100644 --- a/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 3aef1a9396cc..8eff99b849d5 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 7316add3c472..93473021cccc 100644 --- a/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/config/examples/Creality/Ender-4/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 7546bcbd69e1..8dfa6163bb73 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 fdffa1d4f3fd..e50ceab33de4 100644 --- a/config/examples/Einstart-S/Configuration_adv.h +++ b/config/examples/Einstart-S/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 6d819f1f10a9..fcf36b03d698 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 a6c02c8bfe3b..41c7deb80fba 100644 --- a/config/examples/Felix/Configuration_adv.h +++ b/config/examples/Felix/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 2a99cbc600ca..f6edf0f754ac 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 77f3db9b6626..4b02105e62a2 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 ce5bed9f0e52..c4071a2ef87b 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -1672,12 +1672,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 @@ -1687,112 +1687,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 /** @@ -1818,7 +1831,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 5af058965fda..6f515cb68fbd 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 b51b010684e7..1f621718ead9 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 c0b5dd37c0b4..caf2ddcc1bd4 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 96b75a130112..824df6411cf1 100644 --- a/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/config/examples/Formbot/Raptor/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 a3bc74103c3d..c6b1951ce607 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 46c273ab1411..6be709fe5076 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -1677,12 +1677,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 @@ -1692,112 +1692,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 /** @@ -1823,7 +1836,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 ed9465290e18..8d8b68c577fa 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 aa7e13054f94..410abf76392c 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -1678,12 +1678,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 @@ -1693,112 +1693,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 /** @@ -1824,7 +1837,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 d5faaf01283a..a08970ae2cd2 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 c4a58bcce1f5..ea8f43153238 100644 --- a/config/examples/Geeetech/A10M/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 6bb085ea5e06..b55d39061f39 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 c26a87de722e..b39bb92950bf 100644 --- a/config/examples/Geeetech/A20M/Configuration_adv.h +++ b/config/examples/Geeetech/A20M/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 7937be6b859e..f67902bea3cb 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 2dbef1d34d0b..b573d5abf5d4 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 90a01126d799..8ba611064272 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 6a0179369de9..7d369e42ec3a 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 6896b383b8c5..9b13d67d37a2 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 c4c8173e30a0..a8b6cb73cae3 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 9da7890f1b72..2f0563c5189b 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 94ece09db600..cfab672c5bca 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 dac3f226749b..57222bc655cd 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 94ece09db600..cfab672c5bca 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 81d77f4adde3..a9e8da194dfa 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 a775f9bbe25e..436de58ac99f 100644 --- a/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 7f84802dfb27..eb1d29b9d3b2 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 a5e71626de90..15155e6ab1b9 100644 --- a/config/examples/JGAurora/A5/Configuration_adv.h +++ b/config/examples/JGAurora/A5/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 2703b3f2ef50..ef45ffe1e404 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 f4a7a794d4ac..9856bca474dc 100644 --- a/config/examples/MakerParts/Configuration_adv.h +++ b/config/examples/MakerParts/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 8c9da043376b..f8b08918855b 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 dfeb0860da24..b8951ab8d987 100644 --- a/config/examples/Malyan/M150/Configuration_adv.h +++ b/config/examples/Malyan/M150/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 8795313eda0a..e5a69159c861 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 60317604921a..42052933c985 100644 --- a/config/examples/Malyan/M200/Configuration_adv.h +++ b/config/examples/Malyan/M200/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 48dbc0d76642..88c205f52b0d 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 7f100de7396d..b2cdfe1022c4 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 c26c9af3f3ce..7de54a9d9bae 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 ba3e2814f317..23e05535ae98 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 30885395cd0a..5fa74234a1e8 100644 --- a/config/examples/Mks/Robin/Configuration_adv.h +++ b/config/examples/Mks/Robin/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 1c0f9e7a310d..75fb69d65a34 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 adab576c0468..057c5459c2b1 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -1674,12 +1674,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 @@ -1689,112 +1689,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 /** @@ -1820,7 +1833,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 16c79597d5db..6be9a43b03a6 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 68c69d1e7186..286a0f080463 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 d1a8cb0c3d02..5ba254e4919d 100644 --- a/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/config/examples/RapideLite/RL200/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 72984acb99b9..18c300d4709d 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 e931fd299318..98179b06d417 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 26cfbc9c4ee5..306e50686948 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 6a67238c839e..ad827c47a32a 100644 --- a/config/examples/RigidBot/Configuration_adv.h +++ b/config/examples/RigidBot/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 e639d8277f64..41ffd3c391ad 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 e45d504cffcf..d77d16365284 100644 --- a/config/examples/SCARA/Configuration_adv.h +++ b/config/examples/SCARA/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 a7bdafde1d7a..b53a06abe134 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 6431241718b5..5d94c5787206 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 2be54c57bba3..e8a2843aa742 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 ff8edab29d99..9b8620fe7d8e 100644 --- a/config/examples/Sanguinololu/Configuration_adv.h +++ b/config/examples/Sanguinololu/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 761d41458617..6e924a7c820b 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 1dfcc8e0b5c5..369b735ebf43 100644 --- a/config/examples/TheBorg/Configuration_adv.h +++ b/config/examples/TheBorg/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 8fa082e30cec..62318cf1fa95 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 15dd5cdc4d3a..271bae312383 100644 --- a/config/examples/TinyBoy2/Configuration_adv.h +++ b/config/examples/TinyBoy2/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 8cbd6e73cb99..a9eccec8a9a2 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 b5f6e2e3e474..cd5d60b89bc7 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 341dc45007b6..26da73257321 100644 --- a/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/config/examples/Tronxy/X3A/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 f049da3739c1..a96c7782c49f 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 b647fcd0d438..0051ebf2ff49 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 da25bbb6920f..5a5f6f357eb2 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 dd5e9b6c124d..e588a0f7b84e 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 1f3bdab7985e..564933b6b26e 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 9e7ff9746771..9d50f9e60878 100644 --- a/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 99dc6ecd2c73..2cbcc961efb2 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 61b338f8cc1c..fe69e8bc03cd 100644 --- a/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 b3949cca2891..2e19f5d78338 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 78a18fcc88ec..0a589700bfea 100644 --- a/config/examples/VORONDesign/Configuration_adv.h +++ b/config/examples/VORONDesign/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 6dbcbc1c7f56..e857a2dc7ea2 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 22ad25c7e25b..9e35f15718e8 100644 --- a/config/examples/Velleman/K8200/Configuration_adv.h +++ b/config/examples/Velleman/K8200/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/Velleman/K8400/Configuration.h b/config/examples/Velleman/K8400/Configuration.h index 152e82b1f7a5..bf6d5b949521 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 19a98865c88e..9699332ef5f4 100644 --- a/config/examples/Velleman/K8400/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 9971e75d10b7..5fd96ba9d305 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 8e8d0f9da130..c3a9e6fd0fc0 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 296954be6633..469c13bcf261 100644 --- a/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 97c136516951..d7cce721b43b 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 5373fe4e063c..ef36288bea24 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 ad1b5507b8a8..23c8746978e9 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 cd44da1a6cf2..e92edf99b835 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 c3d27b1cf7fe..cea38ef58a2a 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 ab5baa3c06fd..2063798134a2 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 407b059d06dc..faffb6292667 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 516e52b68edd..2f3ff994ad58 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 407b059d06dc..faffb6292667 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 949183938342..6305a036b921 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 fe58c3a5e9f4..3c087bb58305 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 58171ba2aca6..f0ade47ad583 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 fe58c3a5e9f4..3c087bb58305 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 1674933b0be5..4e02c1f7a2b0 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 dc59c17c7a8c..65824c0df8ae 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 7bd2eff310a1..ca83899603f8 100644 --- a/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 88c4dc9dd93c..a9f31026c843 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 da9e9058659f..7f3f47dd80f0 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 745e09c61a85..0493cc543a5f 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 fe58c3a5e9f4..3c087bb58305 100644 --- a/config/examples/delta/generic/Configuration_adv.h +++ b/config/examples/delta/generic/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 54cfb1359216..22f84bab40a6 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 42d9eb7c4086..5799634b34fe 100644 --- a/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/kossel_mini/Configuration_adv.h @@ -1674,12 +1674,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 @@ -1689,112 +1689,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 /** @@ -1820,7 +1833,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 e0604fc49ddc..3668441c1fd5 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 a7a921f96603..4f428a80d8b0 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 fd18a73af72e..e836e886f701 100644 --- a/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/config/examples/delta/kossel_xl/Configuration_adv.h @@ -1675,12 +1675,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 @@ -1690,112 +1690,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 /** @@ -1821,7 +1834,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 e00289c0df27..f2e10269e276 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 3bea6701cff7..5076288f1229 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 c012c76c9297..8a77cc18cd95 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 94bc2eb9bd70..8674dfd8628b 100644 --- a/config/examples/makibox/Configuration_adv.h +++ b/config/examples/makibox/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 c2394f4561c8..2a557cfb2088 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 f6fc5000424a..9a0e70ff1f9a 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 5ef6e7350fb8..af6eb8935534 100644 --- a/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/config/examples/tvrrug/Round2/Configuration_adv.h @@ -1673,12 +1673,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 @@ -1688,112 +1688,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 /** @@ -1819,7 +1832,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 6f2a0c09a2d3..d26ef28211ac 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 85ce90b63004..49667472a214 100644 --- a/config/examples/wt150/Configuration_adv.h +++ b/config/examples/wt150/Configuration_adv.h @@ -1674,12 +1674,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 @@ -1689,112 +1689,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 /** @@ -1820,7 +1833,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS From 9c4f849b233799238616dd07ab01c8c2e3cc53d0 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Sat, 2 Mar 2019 16:51:10 -0600 Subject: [PATCH 14/23] misc bug fixes, external SPI linking doesn't work --- Marlin/src/core/drivers.h | 8 ++++---- Marlin/src/libs/L6470/L6470_Marlin.cpp | 8 ++++---- Marlin/src/libs/L6470/L6470_Marlin.h | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index abb72127ce0b..ffa46c1c1856 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -54,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) ((ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(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)) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index f886bf263ac9..d8d92df3fc27 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -137,7 +137,7 @@ void L6470_Marlin::init() { // Set up SPI and then init chips * 3. copy status layout * 4. make all error bits active low (if needed) */ -uint16_t L6470_Marlin::get_stepper_status(const L64XX &st) { +uint16_t L6470_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; @@ -167,7 +167,7 @@ uint16_t L6470_Marlin::get_status(const L6470_axis_t axis) { #define STATUS_L6470(Q) get_stepper_status(stepper##Q) - switch (axis) { + switch ((uint8_t)axis) { #if AXIS_IS_L64XX(X) case X : return STATUS_L6470(X); #endif @@ -216,7 +216,7 @@ uint32_t L6470_Marlin::get_param(const L6470_axis_t axis, const uint8_t param) { #define GET_L6470_PARAM(Q) L6470_GETPARAM(param,Q) - switch (axis) { + switch ((uint8_t)axis) { #if AXIS_IS_L64XX(X) case X : return GET_L6470_PARAM(X); #endif @@ -265,7 +265,7 @@ void L6470_Marlin::set_param(const L6470_axis_t axis, const uint8_t param, const #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value) - switch (axis) { + switch ((uint8_t)axis) { #if AXIS_IS_L64XX(X) case X : SET_L6470_PARAM(X); #endif diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index eb1bc6cd11b6..7728c1e93531 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -22,6 +22,7 @@ #pragma once #include "../../inc/MarlinConfig.h" +#include "../../pins/pins.h" #include @@ -71,7 +72,7 @@ class L6470_Marlin : public L64XXHelper { static void init(); static void init_to_defaults(); - static uint16_t get_stepper_status(const L64XX &st); + static uint16_t get_stepper_status(L64XX st); static uint16_t get_status(const L6470_axis_t axis); From 89ed68e040bbaf40669b8906c5253585269c779d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Mar 2019 17:53:36 -0600 Subject: [PATCH 15/23] Use 'default' to suppress enum warning --- Marlin/src/libs/L6470/L6470_Marlin.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index d8d92df3fc27..d634ec9ada22 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -167,7 +167,8 @@ uint16_t L6470_Marlin::get_status(const L6470_axis_t axis) { #define STATUS_L6470(Q) get_stepper_status(stepper##Q) - switch ((uint8_t)axis) { + switch (axis) { + default: break; #if AXIS_IS_L64XX(X) case X : return STATUS_L6470(X); #endif @@ -216,7 +217,8 @@ uint32_t L6470_Marlin::get_param(const L6470_axis_t axis, const uint8_t param) { #define GET_L6470_PARAM(Q) L6470_GETPARAM(param,Q) - switch ((uint8_t)axis) { + switch (axis) { + default: break; #if AXIS_IS_L64XX(X) case X : return GET_L6470_PARAM(X); #endif @@ -265,7 +267,8 @@ void L6470_Marlin::set_param(const L6470_axis_t axis, const uint8_t param, const #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value) - switch ((uint8_t)axis) { + switch (axis) { + default: break; #if AXIS_IS_L64XX(X) case X : SET_L6470_PARAM(X); #endif From 3ed70305531d26dc896f4933a9f9a797617281d9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Mar 2019 17:55:37 -0600 Subject: [PATCH 16/23] Pass by reference instead of copying --- Marlin/src/libs/L6470/L6470_Marlin.cpp | 2 +- Marlin/src/libs/L6470/L6470_Marlin.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index d634ec9ada22..aad29f1519bd 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -137,7 +137,7 @@ void L6470_Marlin::init() { // Set up SPI and then init chips * 3. copy status layout * 4. make all error bits active low (if needed) */ -uint16_t L6470_Marlin::get_stepper_status(L64XX st) { +uint16_t L6470_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; diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index 7728c1e93531..895d83e62def 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -22,7 +22,6 @@ #pragma once #include "../../inc/MarlinConfig.h" -#include "../../pins/pins.h" #include @@ -72,7 +71,7 @@ class L6470_Marlin : public L64XXHelper { static void init(); static void init_to_defaults(); - static uint16_t get_stepper_status(L64XX st); + static uint16_t get_stepper_status(L64XX &st); static uint16_t get_status(const L6470_axis_t axis); From d51b63d3d85ce894c2b3cdf24f0e88552b1a6e24 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Mar 2019 21:52:41 -0600 Subject: [PATCH 17/23] Set helper as a pointer instead of a reference --- Marlin/src/libs/L6470/L6470_Marlin.h | 2 +- platformio.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index 895d83e62def..c7550b209194 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -66,7 +66,7 @@ class L6470_Marlin : public L64XXHelper { static volatile bool spi_abort; static bool spi_active; - L6470_Marlin() { L64XX::set_helper(*this); } + L6470_Marlin() { L64XX::set_helper(this); } static void init(); static void init_to_defaults(); diff --git a/platformio.ini b/platformio.ini index 61a5e0f9ff19..5a1372d030db 100644 --- a/platformio.ini +++ b/platformio.ini @@ -34,7 +34,7 @@ lib_deps = TMCStepper@<1.0.0 Adafruit NeoPixel@1.1.3 https://github.com/lincomatic/LiquidTWI2/archive/30aa480.zip - https://github.com/ameyer/Arduino-L6470/archive/0.7.0.zip + https://github.com/ameyer/Arduino-L6470/archive/dev.zip https://github.com/trinamic/TMC26XStepper/archive/c1921b4.zip https://github.com/mikeshub/SailfishLCD.git https://github.com/mikeshub/SailfishRGB_LED.git From 0bfee438058ebb53033d9577af9464545c6c2f80 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Mon, 4 Mar 2019 08:09:26 -0600 Subject: [PATCH 18/23] fix formatting bugs and fix slew rate problem Need to clear the powerup/reset error bits before can set slew rate on L6480/powerSTEP01 --- Marlin/src/gcode/feature/L6470/M122.cpp | 3 ++- Marlin/src/gcode/feature/L6470/M906.cpp | 2 +- Marlin/src/module/stepper_indirection.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/src/gcode/feature/L6470/M122.cpp b/Marlin/src/gcode/feature/L6470/M122.cpp index 2b1d5ac30153..b042c2a66bc3 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -106,7 +106,8 @@ inline void L6470_say_status(const L6470_axis_t axis) { } 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_ECHOLNPGM(" STEP-CLOCK MODE:"); echo_yes_no(sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD); + SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no(sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD); + SERIAL_EOL(); } /** diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index 2faaf3d8b395..b5aa0dea182d 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -140,7 +140,7 @@ void L6470_report_current(L64XX &motor, const L6470_axis_t axis) { } } else { - switch (motor.GetParam(L6470_GATECFG1)) { + 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; } diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper_indirection.cpp index 27503aec43b5..6c76759c6b0b 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper_indirection.cpp @@ -1089,9 +1089,13 @@ void reset_stepper_drivers() { 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: @@ -1100,8 +1104,6 @@ void reset_stepper_drivers() { case 3: st.SetParam(L6470_GATECFG1, CONFIG1_SR_980V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_980V_us); break; } } - st.getStatus(); - st.getStatus(); } #define L6470_INIT_CHIP(Q) L6470_init_chip(stepper##Q, Q##_MICROSTEPS, Q##_OVERCURRENT, Q##_STALLCURRENT, Q##_MAX_VOLTAGE, Q##_SLEW_RATE) From b4f90b393ac20c0b22bf59261605d8aef4c6d422 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Sun, 10 Mar 2019 03:42:56 -0500 Subject: [PATCH 19/23] axis_mon fix Change the way the array axis_mon is defined and how it's passed to the get_user_input function. --- Marlin/src/gcode/feature/L6470/M916-918.cpp | 7 ++++--- Marlin/src/libs/L6470/L6470_Marlin.cpp | 3 ++- Marlin/src/libs/L6470/L6470_Marlin.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index 1605f0577e90..af0a309c68db 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -53,6 +53,7 @@ /** * This routine is also useful for determining the approximate KVAL_HOLD + * where the stepper stops losing steps. The sound will get noticeably quieter * as it stops losing steps. */ @@ -62,7 +63,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPGM("M916"); // Variables used by L64helper.get_user_input function - some may not be used - char *axis_mon[3] = { " ", " ", " " }; // list of Axes to be monitored + 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; @@ -179,7 +180,7 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("M917"); - char *axis_mon[3] = { " ", " ", " " }; // list of axes to be monitored + 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; @@ -453,7 +454,7 @@ void GcodeSuite::M918() { L6470_ECHOLNPGM("M918"); - char *axis_mon[3] = { " ", " ", " " }; // List of axes to monitor + 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; diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index aad29f1519bd..846d403abc35 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -141,6 +141,7 @@ uint16_t L6470_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.BOB_TEMP = st.bob_temp; 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; @@ -325,7 +326,7 @@ inline void err_out_of_bounds() { L6470_ECHOLNPGM("ERROR - motion out of bounds"); } -bool L6470_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char* axis_mon[3], +bool L6470_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 ) { diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index c7550b209194..dcfebb71ea74 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -81,7 +81,7 @@ class L6470_Marlin : public L64XXHelper { //static void send_command(const L6470_axis_t axis, uint8_t command); - static bool get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char* axis_mon[3], + 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); From 59641013a6dd787cad23c7b341839e6521234a94 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Sun, 10 Mar 2019 03:49:47 -0500 Subject: [PATCH 20/23] remove unintended changes --- Marlin/src/gcode/feature/L6470/M916-918.cpp | 1 - Marlin/src/libs/L6470/L6470_Marlin.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index af0a309c68db..be305830c675 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -53,7 +53,6 @@ /** * This routine is also useful for determining the approximate KVAL_HOLD - * where the stepper stops losing steps. The sound will get noticeably quieter * as it stops losing steps. */ diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index 846d403abc35..b1a2b71fac28 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -141,7 +141,6 @@ uint16_t L6470_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.BOB_TEMP = st.bob_temp; 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; From 93198594f27bf99aa830ec12d9a5283ed90f6e42 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Tue, 12 Mar 2019 05:10:30 -0500 Subject: [PATCH 21/23] revert to handlers (pointers) method FULLY FUNCTIONAL using optional external SPI linked via code within Marlin classes. 1) Went back to the handler/pointer method 2) removed helper class from L6470.h 3) renamed L6470_Marlin class to L64XX_MARLIN 4) removed all helper code and renamed anything that had "helper" in it. --- Marlin/src/HAL/shared/HAL_spi_L6470.cpp | 16 +++---- Marlin/src/Marlin.cpp | 4 +- Marlin/src/gcode/calibrate/G28.cpp | 2 +- Marlin/src/gcode/feature/L6470/M122.cpp | 24 +++++----- Marlin/src/gcode/feature/L6470/M906.cpp | 14 +++--- Marlin/src/gcode/feature/L6470/M916-918.cpp | 50 ++++++++++----------- Marlin/src/gcode/host/M114.cpp | 2 +- Marlin/src/libs/L6470/L6470_Marlin.cpp | 47 ++++++++++--------- Marlin/src/libs/L6470/L6470_Marlin.h | 18 ++++---- Marlin/src/module/stepper.cpp | 18 ++++---- Marlin/src/module/stepper_indirection.cpp | 5 ++- Marlin/src/module/stepper_indirection.h | 2 +- 12 files changed, 105 insertions(+), 97 deletions(-) diff --git a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp index df6c02f1579b..3e15f0c1b834 100644 --- a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp +++ b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp @@ -74,9 +74,9 @@ inline uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3 } /** - * L64XXHelper methods for SPI init and transfer + * L64XX methods for SPI init and transfer */ -void L6470_Marlin::spi_init() { +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); @@ -89,25 +89,25 @@ void L6470_Marlin::spi_init() { OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); } -uint8_t L6470_Marlin::transfer(uint8_t data, int16_t ss_pin) { +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); 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; } -uint8_t L6470_Marlin::transfer(uint8_t data, int16_t ss_pin, uint8_t chain_position) { +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); - for (uint8_t i = L64XX::chain[0]; (i >= 1) && !L64helper.spi_abort; i--) { // stop sending data if spi_abort is active + 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 @@ -121,7 +121,7 @@ uint8_t L6470_Marlin::transfer(uint8_t data, int16_t ss_pin, uint8_t chain_posit /** * Platform-supplied L6470 buffer transfer method */ -void L6470_Marlin::transfer(uint8_t L6470_buf[], const uint8_t length) { +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 diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index d27c2f7df41d..d33dc5c0acdd 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -635,7 +635,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - L64helper.monitor_driver(); + L64xx_MARLIN.monitor_driver(); #endif // Limit check_axes_activity frequency to 10Hz @@ -840,7 +840,7 @@ void setup() { #endif #if HAS_L64XX - L64helper.init(); // setup SPI and init chips + L64xx_MARLIN.init(); // setup SPI and init chips #endif #if ENABLED(MAX7219_DEBUG) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 75ba6d177edd..421dd7e7fb90 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -466,7 +466,7 @@ void GcodeSuite::G28(const bool always_home_all) { }; for (uint8_t j = 1; j <= L64XX::chain[0]; j++) { const uint8_t cv = L64XX::chain[j]; - L64helper.set_param((L6470_axis_t)cv, L6470_ABS_POS, stepper.position(L6470_axis_xref[cv])); + 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 b042c2a66bc3..103eac3635f3 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -34,20 +34,20 @@ inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PS void L6470_status_decode(const uint16_t status, const L6470_axis_t axis) { if (Marlin_L6470.spi_abort) return; // don't do anything if set_directions() has occurred - if (L64helper.spi_abort) return; // don't do anything if set_directions() has occurred - L64helper.say_axis(axis); + if (L64xx_MARLIN.spi_abort) return; // don't do anything if set_directions() has occurred + L64xx_MARLIN.say_axis(axis); #if ENABLED(L6470_CHITCHAT) char temp_buf[20]; sprintf_P(temp_buf, PSTR(" status: %4x "), status); SERIAL_ECHO(temp_buf); print_bin(status); #endif - const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; SERIAL_ECHOPGM("\n...OUTPUT: "); serialprintPGM(status & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); SERIAL_ECHOPGM(" BUSY: "); echo_yes_no(!(status & STATUS_BUSY)); SERIAL_ECHOPGM(" DIR: "); - serialprintPGM((((status & STATUS_DIR) >> 4) ^ L64helper.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); + serialprintPGM((((status & STATUS_DIR) >> 4) ^ L64xx_MARLIN.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); SERIAL_ECHOPGM(" Last Command: "); if (status & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("IN"); SERIAL_ECHOPGM("VALID "); @@ -72,10 +72,10 @@ void L6470_status_decode(const uint16_t status, const L6470_axis_t axis) { #endif inline void L6470_say_status(const L6470_axis_t axis) { - if (L64helper.spi_abort) return; - const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; - L64helper.get_status(axis); - L64helper.say_axis(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 "), sh.STATUS_AXIS_RAW); @@ -87,7 +87,7 @@ inline void L6470_say_status(const L6470_axis_t axis) { 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((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64helper.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 (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("IN"); SERIAL_ECHOPGM("VALID "); @@ -115,7 +115,7 @@ inline void L6470_say_status(const L6470_axis_t axis) { */ void GcodeSuite::M122() { - L64helper.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 (parser.seen('S')) // tmc_set_report_interval(parser.value_bool()); @@ -161,8 +161,8 @@ void GcodeSuite::M122() { L6470_say_status(E5); #endif - L64helper.spi_active = false; // done with all SPI transfers - clear handshake flags - L64helper.spi_abort = false; + L64xx_MARLIN.spi_active = false; // done with all SPI transfers - clear handshake flags + L64xx_MARLIN.spi_abort = false; } #endif // HAS_L64XX diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index b5aa0dea182d..0938ceb64721 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -80,8 +80,8 @@ */ void L6470_report_current(L64XX &motor, const L6470_axis_t axis) { - if (L64helper.spi_abort) return; // don't do anything if set_directions() has occurred - const uint16_t status = L64helper.get_status(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, @@ -90,8 +90,8 @@ void L6470_report_current(L64XX &motor, const L6470_axis_t axis) { const float comp_coef = 1600.0f / L6470_ADC_out_limited; const int MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); char temp_buf[80]; - const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; - L64helper.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 "), sh.STATUS_AXIS_RAW); SERIAL_ECHO(temp_buf); @@ -229,7 +229,7 @@ void GcodeSuite::M906() { if (report_current) { #define L6470_REPORT_CURRENT(Q) L6470_report_current(stepper##Q, Q) - L64helper.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_IS_L64XX(X) L6470_REPORT_CURRENT(X); @@ -271,8 +271,8 @@ void GcodeSuite::M906() { L6470_REPORT_CURRENT(E5); #endif - L64helper.spi_active = false; // done with all SPI transfers - clear handshake flags - L64helper.spi_abort = false; + L64xx_MARLIN.spi_active = false; // done with all SPI transfers - clear handshake flags + L64xx_MARLIN.spi_abort = false; } } diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index be305830c675..31809cc4ca2b 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -61,7 +61,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPGM("M916"); - // Variables used by L64helper.get_user_input function - some may not be used + // 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]; @@ -77,7 +77,7 @@ void GcodeSuite::M916() { uint8_t j; // general purpose counter - if (L64helper.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 L6470_ECHOLNPAIR("feedrate = ", final_feedrate); @@ -85,13 +85,13 @@ void GcodeSuite::M916() { planner.synchronize(); // wait for all current movement commands to complete for (j = 0; j < driver_count; j++) - L64helper.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 L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; L6470_ECHOLNPGM(".\n."); @@ -100,7 +100,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPAIR("kval_hold = ", kval_hold); // set & report KVAL_HOLD for this run for (j = 0; j < driver_count; j++) - L64helper.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); @@ -115,7 +115,7 @@ void GcodeSuite::M916() { status_composite = 0; // clear out the old bits for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64helper.get_status(axis_index[j])) & sh.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] ; } @@ -123,7 +123,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } return; } @@ -139,7 +139,7 @@ void GcodeSuite::M916() { L6470_ECHOLNPGM("has occurred"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } } else @@ -194,14 +194,14 @@ void GcodeSuite::M917() { uint8_t j; // general purpose counter - if (L64helper.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 L6470_ECHOLNPAIR("feedrate = ", final_feedrate); planner.synchronize(); // wait for all current movement commands to complete for (j = 0; j < driver_count; j++) - L64helper.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]; @@ -218,7 +218,7 @@ void GcodeSuite::M917() { L6470_ECHOPAIR(" (STALL_TH: ", STALL_TH_val); L6470_ECHOLNPGM(")"); - const L6470_Marlin::L64XX_shadow_t &sh = L64helper.shadow; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; do { @@ -236,7 +236,7 @@ void GcodeSuite::M917() { status_composite = 0; // clear out the old bits for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64helper.get_status(axis_index[j])) & sh.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]; } @@ -244,7 +244,7 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } return; } @@ -260,7 +260,7 @@ void GcodeSuite::M917() { L6470_EOL(); L6470_ECHOLNPAIR("Lowering KVAL_HOLD by about 5% to ", kval_hold); for (j = 0; j < driver_count; j++) - L64helper.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); + L64xx_MARLIN.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); } L6470_ECHOLNPGM("."); gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered @@ -268,7 +268,7 @@ void GcodeSuite::M917() { safe_delay(5000); status_composite_temp = 0; for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64helper.get_status(axis_index[j])) & sh.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]; } } @@ -410,10 +410,10 @@ void GcodeSuite::M917() { if (test_phase != 4) { for (j = 0; j < driver_count; j++) { // update threshold(s) - L64helper.set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val); - L64helper.set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val); - if (L64helper.get_param(axis_index[j], L6470_OCD_TH) != OCD_TH_val) L6470_ECHOLNPGM("OCD mismatch"); - if (L64helper.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) L6470_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) L6470_ECHOLNPGM("OCD mismatch"); + if (L64xx_MARLIN.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) L6470_ECHOLNPGM("STALL mismatch"); } } @@ -423,7 +423,7 @@ void GcodeSuite::M917() { L6470_ECHOLNPGM("Completed with errors"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } } else @@ -467,7 +467,7 @@ void GcodeSuite::M918() { uint8_t j; // general purpose counter - if (L64helper.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 +493,7 @@ void GcodeSuite::M918() { } for (j = 0; j < driver_count; j++) - L64helper.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 L6470_ECHOLNPAIR("target (maximum) feedrate = ",final_feedrate); @@ -503,7 +503,7 @@ void GcodeSuite::M918() { planner.synchronize(); // wait for all current movement commands to complete for (j = 0; j < driver_count; j++) - L64helper.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] = " "; temp_axis_string[0] = axis_mon[0][0]; // need to have a string for use within sprintf format section @@ -526,7 +526,7 @@ void GcodeSuite::M918() { planner.synchronize(); for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64helper.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 @@ -536,7 +536,7 @@ void GcodeSuite::M918() { L6470_ECHOLNPGM("Completed with errors"); for (j = 0; j < driver_count; j++) { L6470_ECHOPGM("..."); - L64helper.error_status_decode(axis_status[j], axis_index[j]); + L64xx_MARLIN.error_status_decode(axis_status[j], axis_index[j]); } } else diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 4883e2b2b9da..64f2f60d1175 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -89,7 +89,7 @@ //#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{ \ - L64helper.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); \ diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index b1a2b71fac28..610b352f143b 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -30,17 +30,17 @@ #include "L6470_Marlin.h" -extern L6470_Marlin L64helper; +L64XX_Marlin L64xx_MARLIN; #include "../../module/stepper_indirection.h" #include "../../gcode/gcode.h" #include "../../module/planner.h" -const char * const L6470_Marlin::index_to_axis[MAX_L6470] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; +const char * const L64XX_Marlin::index_to_axis[MAX_L6470] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; -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 -bool L6470_Marlin::index_to_dir[MAX_L6470] = { INVERT_X_DIR , // 0 X +bool L64XX_Marlin::index_to_dir[MAX_L6470] = { INVERT_X_DIR , // 0 X INVERT_Y_DIR , // 1 Y INVERT_Z_DIR , // 2 Z #if ENABLED(X_DUAL_STEPPER_DRIVERS) @@ -63,10 +63,10 @@ bool L6470_Marlin::index_to_dir[MAX_L6470] = { INVERT_X_DIR INVERT_E5_DIR //12 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; -L6470_Marlin::L64XX_shadow_t L6470_Marlin::shadow; +L64XX_Marlin::L64XX_shadow_t L64XX_Marlin::shadow; //uint32_t UVLO_ADC = 0x0400; // ADC undervoltage event @@ -115,7 +115,7 @@ void L6470_populate_chain_array() { #endif } -void L6470_Marlin::init() { // Set up SPI and then init chips +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); @@ -124,6 +124,13 @@ void L6470_Marlin::init() { // Set up SPI and then init chips #endif 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 @@ -137,7 +144,7 @@ void L6470_Marlin::init() { // Set up SPI and then init chips * 3. copy status layout * 4. make all error bits active low (if needed) */ -uint16_t L6470_Marlin::get_stepper_status(L64XX &st) { +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; @@ -163,7 +170,7 @@ uint16_t L6470_Marlin::get_stepper_status(L64XX &st) { return shadow.STATUS_AXIS; } -uint16_t L6470_Marlin::get_status(const L6470_axis_t axis) { +uint16_t L64XX_Marlin::get_status(const L6470_axis_t axis) { #define STATUS_L6470(Q) get_stepper_status(stepper##Q) @@ -213,7 +220,7 @@ uint16_t L6470_Marlin::get_status(const L6470_axis_t axis) { return 0; // Not needed but kills a compiler warning } -uint32_t L6470_Marlin::get_param(const L6470_axis_t axis, const 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) @@ -263,7 +270,7 @@ uint32_t L6470_Marlin::get_param(const L6470_axis_t axis, const uint8_t param) { return 0 ; // not needed but kills a compiler warning } -void L6470_Marlin::set_param(const L6470_axis_t axis, const uint8_t param, const 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) @@ -325,7 +332,7 @@ inline void err_out_of_bounds() { L6470_ECHOLNPGM("ERROR - motion out of bounds"); } -bool L6470_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index[3], char axis_mon[3][3], +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 ) { @@ -564,7 +571,7 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index #endif /* -char* L6470_Marlin::index_to_axis(const uint8_t index) { +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"), @@ -574,7 +581,7 @@ char* L6470_Marlin::index_to_axis(const uint8_t index) { } */ -void L6470_Marlin::say_axis(const L6470_axis_t axis, const bool label/*=true*/) { +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(' '); @@ -583,10 +590,10 @@ void L6470_Marlin::say_axis(const L6470_axis_t axis, const bool label/*=true*/) SERIAL_CHAR(' '); } -void L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t axis) { // assumes status bits have been inverted +void L64XX_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t axis) { // assumes status bits have been inverted #if ENABLED(L6470_CHITCHAT) char temp_buf[10]; - L64helper.say_axis(axis); + L64xx_MARLIN.say_axis(axis); sprintf_P(temp_buf, PSTR(" %4x "), status); L6470_ECHO(temp_buf); print_bin(status); @@ -663,7 +670,7 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t }; inline void append_stepper_err(char * &p, const uint8_t stepper_index) { - const char * const str = L64helper.index_to_axis[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; @@ -674,7 +681,7 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t if (err) p += sprintf_P(p, err, NULL); } - void L6470_Marlin::monitor_update(uint8_t stepper_index, uint16_t status) { + 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]; @@ -776,7 +783,7 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t } // 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; diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index dcfebb71ea74..531114fcc4c1 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -53,9 +53,11 @@ #define dSPIN_STEP_CLOCK_REV dSPIN_STEP_CLOCK+1 #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)) +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 L6470_Marlin : public L64XXHelper { +class L64XX_Marlin { public: static const char * const index_to_axis[MAX_L6470]; @@ -66,7 +68,7 @@ class L6470_Marlin : public L64XXHelper { static volatile bool spi_abort; static bool spi_active; - L6470_Marlin() { L64XX::set_helper(this); } + L64XX_Marlin() {} static void init(); static void init_to_defaults(); @@ -121,13 +123,11 @@ class L6470_Marlin : public L64XXHelper { static L64XX_shadow_t shadow; - //static uint32_t UVLO_ADC; // ADC undervoltage event - -protected: - // L64XXHelper methods +//protected: static void spi_init(); - static uint8_t transfer(uint8_t data, int16_t ss_pin); - static uint8_t transfer(uint8_t data, int16_t ss_pin, uint8_t chain_position); + 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); + }; -extern L6470_Marlin L64helper; +extern L64XX_Marlin L64xx_MARLIN; diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index acd16949c63e..1b638320d142 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -408,22 +408,22 @@ void Stepper::set_directions() { #if HAS_L64XX if (L64XX_OK_to_power_up) { // OK to send the direction commands (which powers up the L64XX steppers) - if (L64helper.spi_active) { - L64helper.spi_abort = true; // Interrupted a SPI transfer - need to shut it down gracefully + 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 - L64helper.transfer(L6470_buf, L64XX::chain[0]); // Send enough NOOPs to complete any command - L64helper.transfer(L6470_buf, L64XX::chain[0]); - L64helper.transfer(L6470_buf, L64XX::chain[0]); + 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]); } - // L64helper.dir_commands[] is an array that holds direction command for each stepper + // L64xx_MARLIN.dir_commands[] is an array that holds direction command for each stepper - // Scan command array, copy matches into L64helper.transfer + // Scan command array, copy matches into L64xx_MARLIN.transfer for (uint8_t j = 1; j <= L64XX::chain[0]; j++) - L6470_buf[j] = L64helper.dir_commands[L64XX::chain[j]]; + L6470_buf[j] = L64xx_MARLIN.dir_commands[L64XX::chain[j]]; - L64helper.transfer(L6470_buf, L64XX::chain[0]); // send the command stream to the drivers + L64xx_MARLIN.transfer(L6470_buf, L64XX::chain[0]); // send the command stream to the drivers } #endif diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper_indirection.cpp index 6c76759c6b0b..bd57cc52b6e8 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper_indirection.cpp @@ -915,7 +915,7 @@ void reset_stepper_drivers() { #endif #if HAS_L64XX - L64helper.init_to_defaults(); + L64xx_MARLIN.init_to_defaults(); #endif #if HAS_TRINAMIC @@ -1068,6 +1068,7 @@ void reset_stepper_drivers() { // briefly sends power to the steppers 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); @@ -1108,7 +1109,7 @@ void reset_stepper_drivers() { #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() { + void L64XX_Marlin::init_to_defaults() { #if AXIS_IS_L64XX(X) L6470_INIT_CHIP(X); #endif diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h index e50b091e4231..e487b8723e67 100644 --- a/Marlin/src/module/stepper_indirection.h +++ b/Marlin/src/module/stepper_indirection.h @@ -84,7 +84,7 @@ // L6470 has STEP on normal pins, but DIR/ENABLE via SPI #if HAS_L64XX #include "../libs/L6470/L6470_Marlin.h" - #define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L64helper.dir_commands[Q] = (STATE ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0) + #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 From 391cba8e981985208cd1647f38c15fe44caa858d Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Tue, 12 Mar 2019 08:04:23 -0500 Subject: [PATCH 22/23] rebase --- Marlin/src/HAL/HAL_LINUX/include/serial.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Marlin/src/HAL/HAL_LINUX/include/serial.h b/Marlin/src/HAL/HAL_LINUX/include/serial.h index 334d5816a378..9b439de98589 100644 --- a/Marlin/src/HAL/HAL_LINUX/include/serial.h +++ b/Marlin/src/HAL/HAL_LINUX/include/serial.h @@ -138,8 +138,6 @@ 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++) { From ca8301e4c33dce6cc4ee8a3c173c31dea01ad554 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Tue, 19 Mar 2019 07:32:27 -0500 Subject: [PATCH 23/23] fix bugs introduced in previous commit Mostly fixing incomplete conversions and upper/lower case issues --- Marlin/src/core/drivers.h | 8 +- Marlin/src/gcode/feature/L6470/M122.cpp | 41 ---------- Marlin/src/gcode/feature/L6470/M916-918.cpp | 91 ++++++++++++--------- Marlin/src/gcode/host/M114.cpp | 10 +-- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/libs/L6470/L6470_Marlin.cpp | 34 ++++---- Marlin/src/libs/L6470/L6470_Marlin.h | 7 +- 7 files changed, 87 insertions(+), 106 deletions(-) diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index a57dd6713e82..ffa46c1c1856 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -54,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)) diff --git a/Marlin/src/gcode/feature/L6470/M122.cpp b/Marlin/src/gcode/feature/L6470/M122.cpp index 103eac3635f3..f5d9d3113d3a 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -30,47 +30,6 @@ inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); } -#if 0 - -void L6470_status_decode(const uint16_t status, const L6470_axis_t axis) { - if (Marlin_L6470.spi_abort) return; // don't do anything if set_directions() has occurred - if (L64xx_MARLIN.spi_abort) return; // don't do anything if set_directions() has occurred - L64xx_MARLIN.say_axis(axis); - #if ENABLED(L6470_CHITCHAT) - char temp_buf[20]; - sprintf_P(temp_buf, PSTR(" status: %4x "), status); - SERIAL_ECHO(temp_buf); - print_bin(status); - #endif - const L64XX_Marlin::L64XX_shadow_t &sh = L64xx_MARLIN.shadow; - SERIAL_ECHOPGM("\n...OUTPUT: "); - serialprintPGM(status & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); - SERIAL_ECHOPGM(" BUSY: "); echo_yes_no(!(status & STATUS_BUSY)); - SERIAL_ECHOPGM(" DIR: "); - serialprintPGM((((status & STATUS_DIR) >> 4) ^ L64xx_MARLIN.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); - SERIAL_ECHOPGM(" Last Command: "); - if (status & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("IN"); - SERIAL_ECHOPGM("VALID "); - if (sh.STATUS_AXIS_LAYOUT) { - serialprintPGM(status & sh.STATUS_AXIS_NOTPERF_CMD ? PSTR("Not PERFORMED") : PSTR("COMPLETED ")); - SERIAL_ECHOPAIR("\n...THERMAL: ", !(status & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(status & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK "); - } - else switch ((status & (sh.STATUS_AXIS_TH_SD | sh.STATUS_AXIS_TH_WRN)) >> 11) { - case 0: SERIAL_ECHOPGM("\n...THERMAL: DEVICE SHUTDOWN"); break; // these bits were inverted to make them active low - case 1: SERIAL_ECHOPGM("\n...THERMAL: BRIDGE SHUTDOWN"); break; - case 2: SERIAL_ECHOPGM("\n...THERMAL: WARNING "); break; - case 3: SERIAL_ECHOPGM("\n...THERMAL: OK "); break; - } - SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no(!(status & sh.STATUS_AXIS_OCD)); - SERIAL_ECHOPGM(" STALL:"); echo_yes_no(!(status & sh.STATUS_AXIS_STEP_LOSS_A) || !(status & sh.STATUS_AXIS_STEP_LOSS_B)); - SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no(status & sh.STATUS_AXIS_SCK_MOD); - SERIAL_EOL(); -} - -#define L6470_STATUS_DECODE(Q) L6470_status_decode(stepper##Q.getStatus(), Q) - -#endif - 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; diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index 6affd53047e9..88fc19781aa8 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -121,11 +121,14 @@ void GcodeSuite::M916() { 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; } @@ -137,11 +140,14 @@ void GcodeSuite::M916() { } 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 @@ -214,18 +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); @@ -242,16 +248,19 @@ void GcodeSuite::M917() { 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; @@ -259,7 +268,7 @@ 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++) L64xx_MARLIN.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); @@ -275,7 +284,7 @@ void GcodeSuite::M917() { } } while (status_composite_temp & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)); - L6470_EOL(); + DEBUG_EOL(); } if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B | sh.STATUS_AXIS_OCD)) { switch (test_phase) { @@ -295,8 +304,8 @@ void GcodeSuite::M917() { } } 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 { @@ -315,7 +324,7 @@ void GcodeSuite::M917() { 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"); } } @@ -328,21 +337,21 @@ void GcodeSuite::M917() { case 2: { 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 { @@ -356,14 +365,14 @@ void GcodeSuite::M917() { case 3: { 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"); } } @@ -380,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 { @@ -393,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 { @@ -412,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"); } } @@ -425,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 @@ -467,6 +479,8 @@ void GcodeSuite::M918() { 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 (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)) @@ -534,13 +548,16 @@ void GcodeSuite::M918() { 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 diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index a47666b36ef2..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 @@ -93,7 +91,7 @@ //#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,7 +99,7 @@ }while(0) DEBUG_ECHOPGM("\nL6470:"); - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) REPORT_ABSOLUTE_POS(X); #endif #if AXIS_IS_L64XX(X2) 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 80421b4d3eee..bdcd5be8b49a 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -34,16 +34,16 @@ L64XX_Marlin L64xx_MARLIN; #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,10 +83,11 @@ 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) @@ -480,7 +481,7 @@ bool L64XX_Marlin::get_user_input(uint8_t &driver_count, L6470_axis_t axis_index 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 @@ -604,7 +605,10 @@ void L64XX_Marlin::say_axis(const L6470_axis_t axis, const bool label/*=true*/) SERIAL_CHAR(' '); } -void L64XX_Marlin::error_status_decode(const uint16_t status, const L6470_axis_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]; L64xx_MARLIN.say_axis(axis); @@ -612,12 +616,12 @@ void L64XX_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t 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 @@ -847,7 +851,7 @@ void L64XX_Marlin::error_status_decode(const uint16_t status, const L6470_axis_t #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 diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index 8638fcacb9d3..454afe32317b 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -39,7 +39,7 @@ typedef enum : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 } L6470 class L64XX_Marlin { public: - static const char * const index_to_axis[MAX_L6470]; + static char index_to_axis[MAX_L6470][3]; static bool index_to_dir[MAX_L6470]; static uint8_t dir_commands[MAX_L6470]; @@ -75,7 +75,10 @@ class L64XX_Marlin { //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); + 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 {