From 1ad53cee1f4e2768310fca98de0381df9c39b617 Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Mon, 13 Jan 2020 18:47:30 -0600 Subject: [PATCH] Improved STMicro L64XX stepper driver support (#16452) --- Marlin/Configuration.h | 5 +- Marlin/Configuration_adv.h | 91 +- Marlin/src/HAL/HAL_STM32/timers.h | 3 +- Marlin/src/HAL/shared/HAL_spi_L6470.cpp | 99 +- Marlin/src/MarlinCore.cpp | 10 +- Marlin/src/MarlinCore.h | 55 +- Marlin/src/core/drivers.h | 8 + Marlin/src/core/serial.cpp | 8 +- Marlin/src/gcode/calibrate/G28.cpp | 19 +- Marlin/src/gcode/feature/L6470/M122.cpp | 133 +-- Marlin/src/gcode/feature/L6470/M906.cpp | 284 ++++-- Marlin/src/gcode/feature/L6470/M916-918.cpp | 545 +++++++---- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/host/M114.cpp | 38 +- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/libs/L6470/000_l6470_read_me.md | 105 --- Marlin/src/libs/L6470/L6470_Marlin.cpp | 793 ---------------- Marlin/src/libs/L6470/L6470_Marlin.h | 72 -- Marlin/src/libs/L64XX/L64XX_Marlin.cpp | 892 ++++++++++++++++++ Marlin/src/libs/L64XX/L64XX_Marlin.h | 141 +++ Marlin/src/libs/L64XX/README.md | 98 ++ Marlin/src/module/stepper.cpp | 56 +- Marlin/src/module/stepper/L6470.cpp | 143 --- Marlin/src/module/stepper/L6470.h | 176 ---- Marlin/src/module/stepper/L64xx.cpp | 210 +++++ Marlin/src/module/stepper/L64xx.h | 263 ++++++ Marlin/src/module/stepper/indirection.cpp | 4 +- Marlin/src/module/stepper/indirection.h | 4 +- buildroot/share/tests/megaatmega2560-tests | 10 +- config/default/Configuration.h | 5 +- config/default/Configuration_adv.h | 67 +- .../examples/3DFabXYZ/Migbot/Configuration.h | 5 +- .../3DFabXYZ/Migbot/Configuration_adv.h | 67 +- .../ADIMLab/Gantry v1/Configuration.h | 5 +- .../ADIMLab/Gantry v1/Configuration_adv.h | 67 +- .../ADIMLab/Gantry v2/Configuration.h | 5 +- .../ADIMLab/Gantry v2/Configuration_adv.h | 67 +- .../AlephObjects/TAZ4/Configuration.h | 5 +- .../AlephObjects/TAZ4/Configuration_adv.h | 67 +- .../Alfawise/U20-bltouch/Configuration.h | 5 +- .../Alfawise/U20-bltouch/Configuration_adv.h | 67 +- config/examples/Alfawise/U20/Configuration.h | 5 +- .../examples/Alfawise/U20/Configuration_adv.h | 67 +- .../AliExpress/CL-260/Configuration.h | 5 +- .../AliExpress/UM2pExt/Configuration.h | 5 +- .../AliExpress/UM2pExt/Configuration_adv.h | 67 +- config/examples/Anet/A2/Configuration.h | 5 +- config/examples/Anet/A2/Configuration_adv.h | 67 +- config/examples/Anet/A2plus/Configuration.h | 5 +- .../examples/Anet/A2plus/Configuration_adv.h | 67 +- config/examples/Anet/A6/Configuration.h | 5 +- config/examples/Anet/A6/Configuration_adv.h | 67 +- config/examples/Anet/A8/Configuration.h | 5 +- config/examples/Anet/A8/Configuration_adv.h | 67 +- config/examples/Anet/A8plus/Configuration.h | 5 +- .../examples/Anet/A8plus/Configuration_adv.h | 67 +- config/examples/Anet/E10/Configuration.h | 5 +- config/examples/Anet/E10/Configuration_adv.h | 67 +- config/examples/Anet/E16/Configuration.h | 5 +- config/examples/Anet/E16/Configuration_adv.h | 67 +- config/examples/AnyCubic/i3/Configuration.h | 5 +- .../examples/AnyCubic/i3/Configuration_adv.h | 67 +- config/examples/ArmEd/Configuration.h | 5 +- config/examples/ArmEd/Configuration_adv.h | 67 +- .../examples/Artillery/Genius/Configuration.h | 5 +- .../Artillery/Genius/Configuration_adv.h | 67 +- .../Artillery/Sidewinder X1/Configuration.h | 5 +- .../Sidewinder X1/Configuration_adv.h | 67 +- config/examples/Azteeg/X5GT/Configuration.h | 5 +- .../BIBO/TouchX/cyclops/Configuration.h | 5 +- .../BIBO/TouchX/cyclops/Configuration_adv.h | 67 +- .../BIBO/TouchX/default/Configuration.h | 5 +- .../BIBO/TouchX/default/Configuration_adv.h | 67 +- config/examples/BQ/Hephestos/Configuration.h | 5 +- .../examples/BQ/Hephestos/Configuration_adv.h | 67 +- .../examples/BQ/Hephestos_2/Configuration.h | 5 +- .../BQ/Hephestos_2/Configuration_adv.h | 67 +- config/examples/BQ/WITBOX/Configuration.h | 5 +- config/examples/BQ/WITBOX/Configuration_adv.h | 67 +- .../SKR Mini E3 1.0/Configuration.h | 5 +- .../SKR Mini E3 1.0/Configuration_adv.h | 67 +- .../SKR Mini E3 1.2/Configuration.h | 5 +- .../SKR Mini E3 1.2/Configuration_adv.h | 67 +- config/examples/Cartesio/Configuration.h | 5 +- config/examples/Cartesio/Configuration_adv.h | 67 +- .../examples/Creality/CR-10/Configuration.h | 5 +- .../Creality/CR-10/Configuration_adv.h | 67 +- .../examples/Creality/CR-10S/Configuration.h | 5 +- .../Creality/CR-10S/Configuration_adv.h | 67 +- .../Creality/CR-10_5S/Configuration.h | 5 +- .../Creality/CR-10_5S/Configuration_adv.h | 67 +- .../Creality/CR-10mini/Configuration.h | 5 +- .../Creality/CR-10mini/Configuration_adv.h | 67 +- .../Creality/CR-20 Pro/Configuration.h | 5 +- .../Creality/CR-20 Pro/Configuration_adv.h | 67 +- .../examples/Creality/CR-20/Configuration.h | 5 +- .../Creality/CR-20/Configuration_adv.h | 67 +- config/examples/Creality/CR-8/Configuration.h | 5 +- .../Creality/CR-8/Configuration_adv.h | 67 +- .../examples/Creality/Ender-2/Configuration.h | 5 +- .../Creality/Ender-2/Configuration_adv.h | 67 +- .../examples/Creality/Ender-3/Configuration.h | 5 +- .../Creality/Ender-3/Configuration_adv.h | 67 +- .../examples/Creality/Ender-4/Configuration.h | 5 +- .../Creality/Ender-4/Configuration_adv.h | 67 +- .../Creality/Ender-5 Pro/Configuration.h | 5 +- .../Creality/Ender-5 Pro/Configuration_adv.h | 67 +- .../examples/Creality/Ender-5/Configuration.h | 5 +- .../Creality/Ender-5/Configuration_adv.h | 67 +- .../Dagoma/Disco Ultimate/Configuration.h | 5 +- .../Dagoma/Disco Ultimate/Configuration_adv.h | 67 +- .../Imprimante multifonction/Configuration.h | 5 +- .../Configuration_adv.h | 67 +- config/examples/Einstart-S/Configuration.h | 5 +- .../examples/Einstart-S/Configuration_adv.h | 67 +- config/examples/FYSETC/AIO_II/Configuration.h | 5 +- .../FYSETC/AIO_II/Configuration_adv.h | 67 +- .../Cheetah 1.2/BLTouch/Configuration.h | 5 +- .../Cheetah 1.2/BLTouch/Configuration_adv.h | 67 +- .../FYSETC/Cheetah 1.2/base/Configuration.h | 5 +- .../Cheetah 1.2/base/Configuration_adv.h | 67 +- .../FYSETC/Cheetah/BLTouch/Configuration.h | 5 +- .../Cheetah/BLTouch/Configuration_adv.h | 67 +- .../FYSETC/Cheetah/base/Configuration.h | 5 +- .../FYSETC/Cheetah/base/Configuration_adv.h | 67 +- config/examples/FYSETC/F6_13/Configuration.h | 5 +- .../examples/FYSETC/F6_13/Configuration_adv.h | 67 +- config/examples/FYSETC/S6/Configuration.h | 5 +- config/examples/FYSETC/S6/Configuration_adv.h | 67 +- config/examples/Felix/DUAL/Configuration.h | 5 +- .../examples/Felix/DUAL/Configuration_adv.h | 67 +- config/examples/Felix/Single/Configuration.h | 5 +- .../examples/Felix/Single/Configuration_adv.h | 67 +- .../FlashForge/CreatorPro/Configuration.h | 5 +- .../FlashForge/CreatorPro/Configuration_adv.h | 67 +- .../FolgerTech/i3-2020/Configuration.h | 5 +- .../FolgerTech/i3-2020/Configuration_adv.h | 67 +- .../examples/Formbot/Raptor/Configuration.h | 5 +- .../Formbot/Raptor/Configuration_adv.h | 67 +- .../examples/Formbot/T_Rex_2+/Configuration.h | 5 +- .../Formbot/T_Rex_2+/Configuration_adv.h | 67 +- .../examples/Formbot/T_Rex_3/Configuration.h | 5 +- .../Formbot/T_Rex_3/Configuration_adv.h | 67 +- config/examples/Geeetech/A10/Configuration.h | 5 +- .../examples/Geeetech/A10/Configuration_adv.h | 67 +- config/examples/Geeetech/A10D/Configuration.h | 5 +- .../Geeetech/A10D/Configuration_adv.h | 67 +- config/examples/Geeetech/A10M/Configuration.h | 5 +- .../Geeetech/A10M/Configuration_adv.h | 67 +- config/examples/Geeetech/A10T/Configuration.h | 5 +- .../Geeetech/A10T/Configuration_adv.h | 67 +- config/examples/Geeetech/A20/Configuration.h | 5 +- .../examples/Geeetech/A20/Configuration_adv.h | 67 +- config/examples/Geeetech/A20M/Configuration.h | 5 +- .../Geeetech/A20M/Configuration_adv.h | 67 +- config/examples/Geeetech/A20T/Configuration.h | 5 +- .../Geeetech/A20T/Configuration_adv.h | 67 +- config/examples/Geeetech/A30/Configuration.h | 5 +- .../examples/Geeetech/A30/Configuration_adv.h | 67 +- config/examples/Geeetech/D200/Configuration.h | 5 +- .../Geeetech/D200/Configuration_adv.h | 67 +- config/examples/Geeetech/E180/Configuration.h | 5 +- .../Geeetech/E180/Configuration_adv.h | 67 +- .../examples/Geeetech/GT2560/Configuration.h | 5 +- .../Geeetech/I3_Pro_X-GT2560/Configuration.h | 5 +- config/examples/Geeetech/M201/Configuration.h | 5 +- .../Geeetech/M201/Configuration_adv.h | 67 +- .../Geeetech/MeCreator2/Configuration.h | 5 +- .../Geeetech/MeCreator2/Configuration_adv.h | 67 +- .../Geeetech/PI3A PRO/Configuration.h | 5 +- .../Geeetech/PI3A PRO/Configuration_adv.h | 67 +- .../Prusa i3 Pro B/bltouch/Configuration.h | 5 +- .../Prusa i3 Pro B/noprobe/Configuration.h | 5 +- .../Geeetech/Prusa i3 Pro C/Configuration.h | 5 +- .../Prusa i3 Pro C/Configuration_adv.h | 67 +- .../Geeetech/Prusa i3 Pro W/Configuration.h | 5 +- .../Prusa i3 Pro W/Configuration_adv.h | 67 +- config/examples/HMS434/Configuration.h | 5 +- config/examples/HMS434/Configuration_adv.h | 67 +- .../examples/Infitary/i3-M508/Configuration.h | 5 +- .../Infitary/i3-M508/Configuration_adv.h | 67 +- config/examples/JGAurora/A1/Configuration.h | 5 +- .../examples/JGAurora/A1/Configuration_adv.h | 67 +- config/examples/JGAurora/A5/Configuration.h | 5 +- .../examples/JGAurora/A5/Configuration_adv.h | 67 +- config/examples/JGAurora/A5S/Configuration.h | 5 +- .../examples/JGAurora/A5S/Configuration_adv.h | 67 +- .../examples/JGAurora/Magic/Configuration.h | 5 +- .../JGAurora/Magic/Configuration_adv.h | 67 +- .../MakerFarm/Pegasus_12/Configuration.h | 5 +- .../MakerFarm/Pegasus_12/Configuration_adv.h | 67 +- config/examples/MakerParts/Configuration.h | 5 +- .../examples/MakerParts/Configuration_adv.h | 67 +- config/examples/Malyan/M150/Configuration.h | 5 +- .../examples/Malyan/M150/Configuration_adv.h | 67 +- config/examples/Malyan/M200/Configuration.h | 5 +- .../examples/Malyan/M200/Configuration_adv.h | 67 +- .../Micromake/C1/basic/Configuration.h | 5 +- .../Micromake/C1/enhanced/Configuration.h | 5 +- .../Micromake/C1/enhanced/Configuration_adv.h | 67 +- config/examples/Mks/Robin/Configuration.h | 5 +- config/examples/Mks/Robin/Configuration_adv.h | 67 +- .../examples/Mks/Robin_Lite3/Configuration.h | 5 +- config/examples/Mks/Robin_Pro/Configuration.h | 5 +- config/examples/Mks/Sbase/Configuration.h | 5 +- config/examples/Mks/Sbase/Configuration_adv.h | 67 +- config/examples/Modix/Big60/Configuration.h | 5 +- .../examples/Modix/Big60/Configuration_adv.h | 67 +- .../Printrbot/PrintrboardG2/Configuration.h | 5 +- .../examples/RapideLite/RL200/Configuration.h | 5 +- .../RapideLite/RL200/Configuration_adv.h | 67 +- .../examples/Renkforce/RF100/Configuration.h | 5 +- .../Renkforce/RF100/Configuration_adv.h | 67 +- .../Renkforce/RF100XL/Configuration.h | 5 +- .../Renkforce/RF100XL/Configuration_adv.h | 67 +- .../Renkforce/RF100v2/Configuration.h | 5 +- .../Renkforce/RF100v2/Configuration_adv.h | 67 +- .../examples/RepRapPro/Huxley/Configuration.h | 5 +- .../RepRapWorld/Megatronics/Configuration.h | 5 +- config/examples/RigidBot/Configuration.h | 5 +- config/examples/RigidBot/Configuration_adv.h | 67 +- .../examples/SCARA/MP_SCARA/Configuration.h | 5 +- .../SCARA/MP_SCARA/Configuration_adv.h | 91 +- config/examples/SCARA/Morgan/Configuration.h | 5 +- .../examples/SCARA/Morgan/Configuration_adv.h | 67 +- .../STM32/Black_STM32F407VET6/Configuration.h | 5 +- .../Black_STM32F407VET6/Configuration_adv.h | 67 +- .../STM32/STM32F103RE/Configuration.h | 5 +- config/examples/STM32/STM32F4/Configuration.h | 5 +- .../STM32/stm32f103ret6/Configuration.h | 5 +- config/examples/Sanguinololu/Configuration.h | 5 +- .../examples/Sanguinololu/Configuration_adv.h | 67 +- .../Tevo/Michelangelo/Configuration.h | 5 +- .../Tevo/Michelangelo/Configuration_adv.h | 67 +- config/examples/Tevo/Nereus/Configuration.h | 5 +- .../examples/Tevo/Nereus/Configuration_adv.h | 67 +- .../Tevo/Tarantula Pro/Configuration.h | 5 +- .../Tevo/Tarantula Pro/Configuration_adv.h | 67 +- .../Tornado/V1 (MKS Base)/Configuration.h | 5 +- .../Tornado/V1 (MKS Base)/Configuration_adv.h | 67 +- .../Tornado/V2 (MKS GEN-L)/Configuration.h | 5 +- .../V2 (MKS GEN-L)/Configuration_adv.h | 67 +- config/examples/TheBorg/Configuration.h | 5 +- config/examples/TheBorg/Configuration_adv.h | 67 +- config/examples/TinyBoy2/Configuration.h | 5 +- config/examples/TinyBoy2/Configuration_adv.h | 67 +- config/examples/Tronxy/X1/Configuration.h | 5 +- config/examples/Tronxy/X3A/Configuration.h | 5 +- .../examples/Tronxy/X3A/Configuration_adv.h | 67 +- config/examples/Tronxy/X5S-2E/Configuration.h | 7 +- .../Tronxy/X5S-2E/Configuration_adv.h | 67 +- config/examples/Tronxy/X5S/Configuration.h | 5 +- config/examples/Tronxy/XY100/Configuration.h | 5 +- .../UltiMachine/Archim1/Configuration.h | 5 +- .../UltiMachine/Archim1/Configuration_adv.h | 67 +- .../UltiMachine/Archim2/Configuration.h | 5 +- .../UltiMachine/Archim2/Configuration_adv.h | 67 +- config/examples/VORONDesign/Configuration.h | 5 +- .../examples/VORONDesign/Configuration_adv.h | 67 +- .../examples/Velleman/K8200/Configuration.h | 5 +- .../Velleman/K8200/Configuration_adv.h | 67 +- .../Velleman/K8400/Dual-head/Configuration.h | 5 +- .../K8400/Dual-head/Configuration_adv.h | 67 +- .../K8400/Single-head/Configuration.h | 5 +- .../K8400/Single-head/Configuration_adv.h | 67 +- .../examples/WASP/PowerWASP/Configuration.h | 5 +- .../WASP/PowerWASP/Configuration_adv.h | 67 +- .../Wanhao/Duplicator 6/Configuration.h | 5 +- .../Wanhao/Duplicator 6/Configuration_adv.h | 67 +- .../Wanhao/Duplicator i3 2.1/Configuration.h | 5 +- .../Duplicator i3 2.1/Configuration_adv.h | 67 +- .../Wanhao/Duplicator i3 Mini/Configuration.h | 5 +- .../Duplicator i3 Mini/Configuration_adv.h | 67 +- .../examples/adafruit/ST7565/Configuration.h | 5 +- .../delta/Anycubic/Kossel/Configuration.h | 5 +- .../delta/Anycubic/Kossel/Configuration_adv.h | 67 +- .../delta/Dreammaker/Overlord/Configuration.h | 5 +- .../Dreammaker/Overlord/Configuration_adv.h | 67 +- .../Dreammaker/Overlord_Pro/Configuration.h | 5 +- .../Overlord_Pro/Configuration_adv.h | 67 +- .../examples/delta/FLSUN/QQ-S/Configuration.h | 5 +- .../delta/FLSUN/QQ-S/Configuration_adv.h | 67 +- .../FLSUN/auto_calibrate/Configuration.h | 5 +- .../FLSUN/auto_calibrate/Configuration_adv.h | 67 +- .../delta/FLSUN/kossel/Configuration.h | 5 +- .../delta/FLSUN/kossel/Configuration_adv.h | 67 +- .../delta/FLSUN/kossel_mini/Configuration.h | 5 +- .../FLSUN/kossel_mini/Configuration_adv.h | 67 +- .../delta/Geeetech/G2Pro/Configuration_adv.h | 85 +- .../Geeetech/Rostock 301/Configuration.h | 5 +- .../Geeetech/Rostock 301/Configuration_adv.h | 67 +- .../delta/Hatchbox_Alpha/Configuration.h | 5 +- .../examples/delta/MKS/SBASE/Configuration.h | 5 +- .../delta/MKS/SBASE/Configuration_adv.h | 67 +- .../delta/Tevo Little Monster/Configuration.h | 7 +- .../Tevo Little Monster/Configuration_adv.h | 69 +- config/examples/delta/generic/Configuration.h | 5 +- .../delta/generic/Configuration_adv.h | 67 +- .../delta/kossel_clear/Configuration.h | 5 +- .../delta/kossel_clear/Configuration_adv.h | 67 +- .../delta/kossel_mini/Configuration.h | 5 +- .../delta/kossel_mini/Configuration_adv.h | 67 +- .../examples/delta/kossel_pro/Configuration.h | 5 +- .../examples/delta/kossel_xl/Configuration.h | 5 +- .../delta/kossel_xl/Configuration_adv.h | 67 +- .../examples/gCreate/gMax1.5+/Configuration.h | 5 +- .../gCreate/gMax1.5+/Configuration_adv.h | 67 +- config/examples/makibox/Configuration.h | 5 +- config/examples/makibox/Configuration_adv.h | 67 +- config/examples/tvrrug/Round2/Configuration.h | 5 +- .../tvrrug/Round2/Configuration_adv.h | 67 +- config/examples/wt150/Configuration.h | 5 +- config/examples/wt150/Configuration_adv.h | 67 +- platformio.ini | 2 +- 315 files changed, 8582 insertions(+), 5343 deletions(-) delete mode 100644 Marlin/src/libs/L6470/000_l6470_read_me.md delete mode 100644 Marlin/src/libs/L6470/L6470_Marlin.cpp delete mode 100644 Marlin/src/libs/L6470/L6470_Marlin.h create mode 100644 Marlin/src/libs/L64XX/L64XX_Marlin.cpp create mode 100644 Marlin/src/libs/L64XX/L64XX_Marlin.h create mode 100644 Marlin/src/libs/L64XX/README.md delete mode 100644 Marlin/src/module/stepper/L6470.cpp delete mode 100644 Marlin/src/module/stepper/L6470.h create mode 100644 Marlin/src/module/stepper/L64xx.cpp create mode 100644 Marlin/src/module/stepper/L64xx.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 7a6e43c7a8..3c34718562 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', '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 95fae1ec26..019180b282 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/Marlin/src/HAL/HAL_STM32/timers.h b/Marlin/src/HAL/HAL_STM32/timers.h index dda7a8ce9a..001b298535 100644 --- a/Marlin/src/HAL/HAL_STM32/timers.h +++ b/Marlin/src/HAL/HAL_STM32/timers.h @@ -33,7 +33,6 @@ #define hal_timer_t uint32_t #define HAL_TIMER_TYPE_MAX 0xFFFFFFFF // Timers can be 16 or 32 bit - #ifdef STM32F0xx #define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals @@ -63,7 +62,7 @@ #define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals #ifndef STEP_TIMER - #define STEP_TIMER 6 + #define STEP_TIMER 9 // STM32F401 has no TIM6, TIM7, or TIM8 #endif #ifndef TEMP_TIMER diff --git a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp index 936acc7ce8..e740a171d8 100644 --- a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp +++ b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp @@ -27,12 +27,12 @@ #include "../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "Delay.h" #include "../../core/serial.h" -#include "../../libs/L6470/L6470_Marlin.h" +#include "../../libs/L64XX/L64XX_Marlin.h" // Make sure GCC optimizes this file. // Note that this line triggers a bug in GCC which is fixed by casting. @@ -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,61 +56,26 @@ 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); DELAY_NS(125); // 10 cycles @ 84mhz - WRITE(L6470_CHAIN_SCK_PIN, HIGH); + DELAY_NS(125); // Need more delay for fast CPUs b <<= 1; // little setup time b |= (READ(L6470_CHAIN_MISO_PIN) != 0); } - - DELAY_NS(125); // 10 cycles @ 84mhz + DELAY_NS(125); // 10 cycles @ 84mhz return b; } /** - * The following are weak-linked and defined as do-nothing - * functions by the L6470-Arduino library. They must be - * defined by the client (Marlin) to provide an SPI interface. + * L64XX methods for SPI init and transfer */ - -uint8_t L6470_transfer(uint8_t data, int16_t ss_pin, const uint8_t chain_position) { - uint8_t data_out = 0; - - // 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; - } - - extDigitalWrite(ss_pin, HIGH); - return data_out; -} - -void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) { - // first device in chain has 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); -} - -void L6470_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); @@ -123,6 +88,52 @@ void L6470_spi_init() { OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); } +uint8_t L64XX_Marlin::transfer_single(uint8_t data, int16_t ss_pin) { + // First device in chain has data sent last + extDigitalWrite(ss_pin, LOW); + + 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; +} + +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 + extDigitalWrite(ss_pin, LOW); + + for (uint8_t i = L64XX::chain[0]; !L64xxManager.spi_abort && i >= 1; i--) { // Send data unless aborted + 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; + } + + extDigitalWrite(ss_pin, HIGH); + return data_out; +} + +/** + * Platform-supplied L6470 buffer transfer method + */ +void L64XX_Marlin::transfer(uint8_t L6470_buf[], const uint8_t length) { + // First device in chain has its data sent last + + if (spi_active) { // Interrupted SPI transfer so need to + WRITE(L6470_CHAIN_SS_PIN, HIGH); // guarantee min high of 650ns + DELAY_US(1); + } + + WRITE(L6470_CHAIN_SS_PIN, LOW); + for (uint8_t i = length; i >= 1; i--) + L6470_SpiTransfer_Mode_3(uint8_t(L6470_buf[i])); + WRITE(L6470_CHAIN_SS_PIN, HIGH); +} + #pragma GCC reset_options -#endif // HAS_DRIVER(L6470) +#endif // HAS_L64XX diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index f58477e810..55e1f033aa 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -177,8 +177,8 @@ #include "feature/prusa_MMU2/mmu2.h" #endif -#if HAS_DRIVER(L6470) - #include "libs/L6470/L6470_Marlin.h" +#if HAS_L64XX + #include "libs/L64XX/L64XX_Marlin.h" #endif const char NUL_STR[] PROGMEM = "", @@ -605,7 +605,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - L6470.monitor_driver(); + L64xxManager.monitor_driver(); #endif // Limit check_axes_activity frequency to 10Hz @@ -822,8 +822,8 @@ void setup() { HAL_init(); - #if HAS_DRIVER(L6470) - L6470.init(); // setup SPI and then init chips + #if HAS_L64XX + L64xxManager.init(); // Set up SPI, init drivers #endif #if ENABLED(MAX7219_DEBUG) diff --git a/Marlin/src/MarlinCore.h b/Marlin/src/MarlinCore.h index 8b44298a91..9cc06b20c0 100644 --- a/Marlin/src/MarlinCore.h +++ b/Marlin/src/MarlinCore.h @@ -31,8 +31,8 @@ #include #include -#if HAS_DRIVER(L6470) - #include "libs/L6470/L6470_Marlin.h" +#if HAS_L64XX + #include "libs/L64XX/L64XX_Marlin.h" extern uint8_t axis_known_position; #endif @@ -49,8 +49,7 @@ 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 +60,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 +74,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 +85,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 +99,7 @@ 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 +110,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 +121,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 @@ -147,8 +140,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); // // 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 +151,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 +162,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 +173,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 +184,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 +195,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 @@ -253,7 +240,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #else // !MIXING_EXTRUDER - #if HAS_E0_ENABLE + #if (HAS_E0_ENABLE || AXIS_IS_L64XX(E0)) #define enable_E0() E0_enable() #define disable_E0() E0_disable() #else @@ -261,7 +248,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define disable_E0() NOOP #endif - #if E_STEPPERS > 1 && HAS_E1_ENABLE + #if E_STEPPERS > 1 && (HAS_E1_ENABLE || AXIS_IS_L64XX(E1)) #define enable_E1() E1_enable() #define disable_E1() E1_disable() #else @@ -269,7 +256,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define disable_E1() NOOP #endif - #if E_STEPPERS > 2 && HAS_E2_ENABLE + #if E_STEPPERS > 2 && (HAS_E2_ENABLE || AXIS_IS_L64XX(E2)) #define enable_E2() E2_enable() #define disable_E2() E2_disable() #else @@ -277,7 +264,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define disable_E2() NOOP #endif - #if E_STEPPERS > 3 && HAS_E3_ENABLE + #if E_STEPPERS > 3 && (HAS_E3_ENABLE || AXIS_IS_L64XX(E3)) #define enable_E3() E3_enable() #define disable_E3() E3_disable() #else @@ -285,7 +272,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define disable_E3() NOOP #endif - #if E_STEPPERS > 4 && HAS_E4_ENABLE + #if E_STEPPERS > 4 && (HAS_E4_ENABLE || AXIS_IS_L64XX(E4)) #define enable_E4() E4_enable() #define disable_E4() E4_disable() #else @@ -293,7 +280,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #define disable_E4() NOOP #endif - #if E_STEPPERS > 5 && HAS_E5_ENABLE + #if E_STEPPERS > 5 && (HAS_E5_ENABLE || AXIS_IS_L64XX(E5)) #define enable_E5() E5_enable() #define disable_E5() E5_disable() #else diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index 0cafb81231..5c76b234ee 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -28,6 +28,9 @@ #define _DRV8825 0x8825 #define _LV8729 0x8729 #define _L6470 0x6470 +#define _L6474 0x6474 +#define _L6480 0x6480 +#define _POWERSTEP01 0xF00D #define _TB6560 0x6560 #define _TB6600 0x6600 #define _TMC2100 0x2100 @@ -156,3 +159,8 @@ #define _SDCARD_CUSTOM_CABLE 3 #define _SDCARD_ID(V) _CAT(_SDCARD_, V) #define SD_CONNECTION_IS(V) (_SDCARD_ID(SDCARD_CONNECTION) == _SDCARD_ID(V)) + +#define HAS_L64XX (HAS_DRIVER(L6470) || HAS_DRIVER(L6474) || HAS_DRIVER(L6480) || HAS_DRIVER(POWERSTEP01)) +#define HAS_L64XX_NOT_L6474 (HAS_L64XX && !HAS_DRIVER(L6474)) + +#define AXIS_IS_L64XX(A) (AXIS_DRIVER_TYPE_##A(L6470) || AXIS_DRIVER_TYPE_##A(L6474) || AXIS_DRIVER_TYPE_##A(L6480) || AXIS_DRIVER_TYPE_##A(POWERSTEP01)) diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 4a5214f5c0..534d94f00a 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -58,12 +58,10 @@ void serialprint_onoff(const bool onoff) { serialprintPGM(onoff ? PSTR(MSG_ON) : void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EOL(); } void serialprint_truefalse(const bool tf) { serialprintPGM(tf ? PSTR("true") : PSTR("false")); } -void print_bin(const uint16_t val) { - uint16_t mask = 0x8000; +void print_bin(uint16_t val) { for (uint8_t i = 16; i--;) { - if (i && !(i % 4)) SERIAL_CHAR(' '); - SERIAL_CHAR((val & mask) ? '1' : '0'); - mask >>= 1; + SERIAL_CHAR('0' + TEST(val, i)); + if (!(i & 0x3) && i) SERIAL_CHAR(' '); } } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index db6ae7a682..17d1920450 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -47,8 +47,8 @@ #include "../../lcd/ultralcd.h" -#if HAS_DRIVER(L6470) // set L6470 absolute position registers to counts - #include "../../libs/L6470/L6470_Marlin.h" +#if HAS_L64XX // set L6470 absolute position registers to counts + #include "../../libs/L64XX/L64XX_Marlin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -526,11 +526,18 @@ void GcodeSuite::G28(const bool always_home_all) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G28"); - #if HAS_DRIVER(L6470) + #if HAS_L64XX // Set L6470 absolute position registers to counts - for (uint8_t j = 1; j <= L6470::chain[0]; j++) { - const uint8_t cv = L6470::chain[j]; - L6470.set_param(cv, L6470_ABS_POS, stepper.position((AxisEnum)L6470.axis_xref[cv])); + // constexpr *might* move this to PROGMEM. + // If not, this will need a PROGMEM directive and an accessor. + static constexpr AxisEnum L6470_axis_xref[MAX_L6470] = { + X_AXIS, Y_AXIS, Z_AXIS, + X_AXIS, Y_AXIS, Z_AXIS, Z_AXIS, + E_AXIS, E_AXIS, E_AXIS, E_AXIS, E_AXIS, E_AXIS + }; + for (uint8_t j = 1; j <= L64XX::chain[0]; j++) { + const uint8_t cv = L64XX::chain[j]; + L64xxManager.set_param((L64XX_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 1fbb72aacf..544a5cf410 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -22,36 +22,64 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "../../gcode.h" -#include "../../../libs/L6470/L6470_Marlin.h" +#include "../../../libs/L64XX/L64XX_Marlin.h" #include "../../../module/stepper/indirection.h" -inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); } +void echo_yes_no(const bool yes); -void L6470_status_decode(const uint16_t status, const uint8_t axis) { - if (L6470.spi_abort) return; // don't do anything if set_directions() has occurred - L6470.say_axis(axis); +inline void L6470_say_status(const L64XX_axis_t axis) { + if (L64xxManager.spi_abort) return; + const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; + L64xxManager.get_status(axis); + L64xxManager.say_axis(axis); #if ENABLED(L6470_CHITCHAT) char temp_buf[20]; - sprintf_P(temp_buf, PSTR(" status: %4x "), status); + sprintf_P(temp_buf, PSTR(" status: %4x "), sh.STATUS_AXIS_RAW); SERIAL_ECHO(temp_buf); - print_bin(status); + print_bin(sh.STATUS_AXIS_RAW); + switch (sh.STATUS_AXIS_LAYOUT) { + case L6470_STATUS_LAYOUT: serialprintPGM(PSTR(" L6470")); break; + case L6474_STATUS_LAYOUT: serialprintPGM(PSTR(" L6474")); break; + case L6480_STATUS_LAYOUT: serialprintPGM(PSTR(" L6480/powerSTEP01")); break; + } #endif SERIAL_ECHOPGM("\n...OUTPUT: "); - serialprintPGM(status & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); - SERIAL_ECHOPGM(" BUSY: "); echo_yes_no(!(status & STATUS_BUSY)); + serialprintPGM(sh.STATUS_AXIS & STATUS_HIZ ? PSTR("OFF") : PSTR("ON ")); + SERIAL_ECHOPGM(" BUSY: "); echo_yes_no((sh.STATUS_AXIS & STATUS_BUSY) == 0); SERIAL_ECHOPGM(" DIR: "); - serialprintPGM((((status & STATUS_DIR) >> 4) ^ L6470.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); - SERIAL_ECHOPGM(" Last Command: "); - if (status & STATUS_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); + serialprintPGM((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64xxManager.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE")); + if (sh.STATUS_AXIS_LAYOUT == L6480_STATUS_LAYOUT) { + SERIAL_ECHOPGM(" Last Command: "); + if (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("VALID"); + else SERIAL_ECHOPGM("ERROR"); + 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; + } + } + else { + SERIAL_ECHOPGM(" Last Command: "); + if (!(sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD)) SERIAL_ECHOPGM("IN"); + SERIAL_ECHOPGM("VALID "); + serialprintPGM(sh.STATUS_AXIS & sh.STATUS_AXIS_NOTPERF_CMD ? PSTR("COMPLETED ") : PSTR("Not PERFORMED")); + SERIAL_ECHOPAIR("\n...THERMAL: ", !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK "); + } + SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_OCD) == 0); + if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) { + SERIAL_ECHOPGM(" STALL:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_STEP_LOSS_A) == 0 || (sh.STATUS_AXIS & sh.STATUS_AXIS_STEP_LOSS_B) == 0); + SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD) != 0); + } + else { + SERIAL_ECHOPGM(" STALL: NA " + " STEP-CLOCK MODE: NA" + " UNDER VOLTAGE LOCKOUT: "); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_UVLO) == 0); + } SERIAL_EOL(); } @@ -59,57 +87,56 @@ void L6470_status_decode(const uint16_t status, const uint8_t axis) { * 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) + L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status + L64xxManager.spi_active = true; // Tell set_directions() a series of SPI transfers is underway //if (parser.seen('S')) - // tmc_set_report_interval(parser.value_bool()); + // 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; + L64xxManager.spi_active = false; // done with all SPI transfers - clear handshake flags + L64xxManager.spi_abort = false; + L64xxManager.pause_monitor(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 72de90fc50..d6bf8a53c9 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -22,10 +22,10 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "../../gcode.h" -#include "../../../libs/L6470/L6470_Marlin.h" +#include "../../../libs/L64XX/L64XX_Marlin.h" #include "../../../module/stepper/indirection.h" #include "../../../module/planner.h" @@ -37,6 +37,8 @@ * M906: report or set KVAL_HOLD which sets the maximum effective voltage provided by the * PWMs to the steppers * + * On L6474 this sets the TVAL register (same address). + * * J - select which driver(s) to monitor on multi-driver axis * 0 - (default) monitor all drivers on the axis or E0 * 1 - monitor only X, Y, Z or E1 @@ -81,89 +83,162 @@ * KVAL_DEC * Vs compensation (if enabled) */ +void L6470_report_current(L64XX &motor, const L64XX_axis_t axis) { -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); - char temp_buf[80]; - L6470.say_axis(axis); - #if ENABLED(L6470_CHITCHAT) - sprintf_P(temp_buf, PSTR(" status: %4x "), status); - DEBUG_ECHO(temp_buf); - print_bin(status); - #endif - sprintf_P(temp_buf, PSTR("\n...OverCurrent Threshold: %2d (%4d mA)"), overcurrent_threshold, (overcurrent_threshold + 1) * 375); - SERIAL_ECHO(temp_buf); + if (L64xxManager.spi_abort) return; // don't do anything if set_directions() has occurred - char numstr[11]; - dtostrf((stall_threshold + 1) * 31.25, 1, 2, numstr); - sprintf_P(temp_buf, PSTR(" Stall Threshold: %2d (%s mA)"), stall_threshold, numstr); - SERIAL_ECHO(temp_buf); + const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; + const uint16_t status = L64xxManager.get_status(axis); //also populates shadow structure + const uint8_t OverCurrent_Threshold = uint8_t(motor.GetParam(L6470_OCD_TH)); - SERIAL_ECHOPGM(" Motor Status: "); - const char *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; + auto say_axis_status = [](const L64XX_axis_t axis, const uint16_t status) { + L64xxManager.say_axis(axis); + #if ENABLED(L6470_CHITCHAT) + char tmp[10]; + sprintf_P(tmp, PSTR("%4x "), status); + DEBUG_ECHOPAIR(" status: ", tmp); + print_bin(status); + #else + UNUSED(status); + #endif + SERIAL_EOL(); + }; + + char temp_buf[10]; + + switch (sh.STATUS_AXIS_LAYOUT) { + case L6470_STATUS_LAYOUT: // L6470 + case L6480_STATUS_LAYOUT: { // L6480 & powerstep01 + const uint16_t 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 uint16_t MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); + + say_axis_status(axis, status); + + SERIAL_ECHOPGM("...OverCurrent Threshold: "); + sprintf_P(temp_buf, PSTR("%2d ("), OverCurrent_Threshold); + SERIAL_ECHO(temp_buf); + SERIAL_ECHO((OverCurrent_Threshold + 1) * motor.OCD_CURRENT_CONSTANT_INV); + SERIAL_ECHOPGM(" mA)"); + SERIAL_ECHOPGM(" Stall Threshold: "); + sprintf_P(temp_buf, PSTR("%2d ("), Stall_Threshold); + SERIAL_ECHO(temp_buf); + SERIAL_ECHO((Stall_Threshold + 1) * motor.STALL_CURRENT_CONSTANT_INV); + SERIAL_ECHOPGM(" mA)"); + SERIAL_ECHOPGM(" Motor Status: "); + switch (motor_status) { + 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; + } + SERIAL_EOL(); + + SERIAL_ECHOPAIR("...MicroSteps: ", MicroSteps, + " ADC_OUT: ", L6470_ADC_out); + SERIAL_ECHOPGM(" Vs_compensation: "); + serialprintPGM((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED")); + SERIAL_ECHOLNPAIR(" Compensation coefficient: ~", comp_coef * 0.01f); + + SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD), + " KVAL_RUN : ", motor.GetParam(L6470_KVAL_RUN), + " KVAL_ACC: ", motor.GetParam(L6470_KVAL_ACC), + " KVAL_DEC: ", motor.GetParam(L6470_KVAL_DEC), + " V motor max = "); + switch (motor_status) { + case 0: SERIAL_ECHO(motor.GetParam(L6470_KVAL_HOLD) * 100 / 256); SERIAL_ECHOPGM("% (KVAL_HOLD)"); break; + case 1: SERIAL_ECHO(motor.GetParam(L6470_KVAL_RUN) * 100 / 256); SERIAL_ECHOPGM("% (KVAL_RUN)"); break; + case 2: SERIAL_ECHO(motor.GetParam(L6470_KVAL_ACC) * 100 / 256); SERIAL_ECHOPGM("% (KVAL_ACC)"); break; + case 3: SERIAL_ECHO(motor.GetParam(L6470_KVAL_DEC) * 100 / 256); SERIAL_ECHOPGM("% (KVAL_HOLD)"); break; + } + SERIAL_EOL(); + + #if ENABLED(L6470_CHITCHAT) + DEBUG_ECHOPGM("...SLEW RATE: "); + switch (sh.STATUS_AXIS_LAYOUT) { + case L6470_STATUS_LAYOUT: { + switch ((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT) { + case 0: { DEBUG_ECHOLNPGM("320V/uS") ; break; } + case 1: { DEBUG_ECHOLNPGM("75V/uS") ; break; } + case 2: { DEBUG_ECHOLNPGM("110V/uS") ; break; } + case 3: { DEBUG_ECHOLNPGM("260V/uS") ; break; } + } + break; + } + case L6480_STATUS_LAYOUT: { + switch (motor.GetParam(L6470_GATECFG1) & CONFIG1_SR ) { + case CONFIG1_SR_220V_us: { DEBUG_ECHOLNPGM("220V/uS") ; break; } + case CONFIG1_SR_400V_us: { DEBUG_ECHOLNPGM("400V/uS") ; break; } + case CONFIG1_SR_520V_us: { DEBUG_ECHOLNPGM("520V/uS") ; break; } + case CONFIG1_SR_980V_us: { DEBUG_ECHOLNPGM("980V/uS") ; break; } + default: { DEBUG_ECHOLNPGM("unknown") ; break; } + } + } + } + #endif + SERIAL_EOL(); + break; + } + + case L6474_STATUS_LAYOUT: { // L6474 + const uint16_t L6470_ADC_out = motor.GetParam(L6470_ADC_OUT) & 0x1F, + L6474_TVAL_val = motor.GetParam(L6474_TVAL) & 0x7F; + + say_axis_status(axis, status); + + SERIAL_ECHOPGM("...OverCurrent Threshold: "); + sprintf_P(temp_buf, PSTR("%2d ("), OverCurrent_Threshold); + SERIAL_ECHO(temp_buf); + SERIAL_ECHO((OverCurrent_Threshold + 1) * motor.OCD_CURRENT_CONSTANT_INV); + SERIAL_ECHOPGM(" mA)"); + SERIAL_ECHOPGM(" TVAL: "); + sprintf_P(temp_buf, PSTR("%2d ("), L6474_TVAL_val); + SERIAL_ECHO(temp_buf); + SERIAL_ECHO((L6474_TVAL_val + 1) * motor.STALL_CURRENT_CONSTANT_INV); + SERIAL_ECHOLNPGM(" mA Motor Status: NA)"); + + const uint16_t MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); //NOMORE(MicroSteps, 16); + SERIAL_ECHOLNPAIR("...MicroSteps: ", MicroSteps, + " ADC_OUT: ", L6470_ADC_out); + + SERIAL_ECHOLNPGM(" Vs_compensation: NA\n" + "...KVAL_HOLD: NA" + " KVAL_RUN : NA" + " KVAL_ACC: NA" + " KVAL_DEC: NA" + " V motor max = NA"); + + #if ENABLED(L6470_CHITCHAT) + DEBUG_ECHOPGM("...SLEW RATE: "); + switch ((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT) { + case 0: DEBUG_ECHOLNPGM("320V/uS") ; break; + case 1: DEBUG_ECHOLNPGM("75V/uS") ; break; + case 2: DEBUG_ECHOLNPGM("110V/uS") ; break; + case 3: DEBUG_ECHOLNPGM("260V/uS") ; break; + default: DEBUG_ECHOLNPAIR("slew rate: ", (motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT); break; + } + #endif + SERIAL_EOL(); + SERIAL_EOL(); + break; + } } - serialprintPGM(stat_str); - SERIAL_EOL(); - - SERIAL_ECHOPAIR("...microsteps: ", microsteps); - SERIAL_ECHOPAIR(" ADC_OUT: ", adc_out); - SERIAL_ECHOPGM(" Vs_compensation: "); - serialprintPGM((motor.GetParam(L6470_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED")); - - SERIAL_ECHOLNPAIR(" Compensation coefficient: ", dtostrf(comp_coef * 0.01f, 7, 2, numstr)); - SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD)); - SERIAL_ECHOPAIR(" KVAL_RUN : ", motor.GetParam(L6470_KVAL_RUN)); - SERIAL_ECHOPAIR(" KVAL_ACC: ", motor.GetParam(L6470_KVAL_ACC)); - SERIAL_ECHOPAIR(" KVAL_DEC: ", motor.GetParam(L6470_KVAL_DEC)); - SERIAL_ECHOPGM(" V motor max = "); - float val; - PGM_P suf; - switch (motor_status) { - case 0: - val = motor.GetParam(L6470_KVAL_HOLD); - suf = PSTR("(KVAL_HOLD)"); - break; - case 1: - val = motor.GetParam(L6470_KVAL_RUN); - suf = PSTR("(KVAL_RUN)"); - break; - case 2: - val = motor.GetParam(L6470_KVAL_ACC); - suf = PSTR("(KVAL_ACC)"); - break; - case 3: - val = motor.GetParam(L6470_KVAL_DEC); - suf = PSTR("(KVAL_DEC)"); - break; - } - SERIAL_ECHO(dtostrf(val * 100 / 256, 10, 2, numstr)); - SERIAL_ECHOPGM("%% "); - serialprintPGM(suf); - SERIAL_EOL(); } void GcodeSuite::M906() { + + L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status + #define L6470_SET_KVAL_HOLD(Q) stepper##Q.SetParam(L6470_KVAL_HOLD, value) DEBUG_ECHOLNPGM("M906"); - bool report_current = true; + uint8_t report_current = true; - #if HAS_DRIVER(L6470) + #if HAS_L64XX const uint8_t index = parser.byteval('I'); #endif @@ -172,35 +247,35 @@ void GcodeSuite::M906() { report_current = false; if (planner.has_blocks_queued() || planner.cleaning_buffer_counter) { - SERIAL_ECHOLNPGM("!Can't set KVAL_HOLD with steppers moving"); + SERIAL_ECHOLNPGM("Test aborted. Can't set KVAL_HOLD while steppers are moving."); return; } 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; @@ -208,22 +283,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 } @@ -234,51 +309,52 @@ 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 + L64xxManager.spi_active = true; // Tell set_directions() a series of SPI transfers is underway - #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; + L64xxManager.spi_active = false; // done with all SPI transfers - clear handshake flags + L64xxManager.spi_abort = false; + L64xxManager.pause_monitor(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 96a27f3330..9827fc38f5 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -20,35 +20,26 @@ * */ +// +// NOTE: All tests assume each axis uses matching driver chips. +// + #include "../../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) +#if HAS_L64XX #include "../../gcode.h" #include "../../../module/stepper/indirection.h" #include "../../../module/planner.h" -#include "../../../libs/L6470/L6470_Marlin.h" +#include "../../../libs/L64XX/L64XX_Marlin.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../../core/debug_out.h" -static void jiggle_axis(const char axis_char, const float &min, const float &max, const feedRate_t &fr_mm_m) { - char gcode_string[30], str1[11], str2[11]; - - // Turn the motor(s) both directions - sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(min, 1, 3, str1), dtostrf(fr_mm_m, 1, 3, str2)); - gcode.process_subcommands_now(gcode_string); - - sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(max, 1, 3, str1), str2); - gcode.process_subcommands_now(gcode_string); - - planner.synchronize(); -} - /** * - * M916: Increase KVAL_HOLD until thermal warning - * + * M916: increase KVAL_HOLD until get thermal warning + * NOTE - on L6474 it is TVAL that is used * * J - select which driver(s) to monitor on multi-driver axis * 0 - (default) monitor all drivers on the axis or E0 @@ -62,8 +53,14 @@ static void jiggle_axis(const char axis_char, const float &min, const float &max * F - feedrate * optional - will use default max feedrate from configuration.h if not specified * - * K - starting value for KVAL_HOLD (0 - 255) - * optional - will use & report current value from driver if not specified + * T - current (mA) setting for TVAL (0 - 4A in 31.25mA increments, rounds down) - L6474 only + * optional - will report current value from driver if not specified + * + * K - value for KVAL_HOLD (0 - 255) (ignored for L6474) + * optional - will report current value from driver if not specified + * + * D - time (in seconds) to run each setting of KVAL_HOLD/TVAL + * optional - defaults to zero (runs each setting once) * */ @@ -77,80 +74,115 @@ void GcodeSuite::M916() { DEBUG_ECHOLNPGM("M916"); - // Variables used by L6470_get_user_input function - some may not be used - char axis_mon[3][3] = { " ", " ", " " }; // list of Axes to be monitored - uint8_t axis_index[3]; + L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status + + // Variables used by L64xxManager.get_user_input function - some may not be used + char axis_mon[3][3] = { {" "}, {" "}, {" "} }; // list of Axes to be monitored + L64XX_axis_t axis_index[3]; uint16_t axis_status[3]; uint8_t driver_count = 1; float position_max; float position_min; - feedRate_t final_fr_mm_m; + 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 + constexpr uint8_t over_current_flag = false; // M916 doesn't play with the overcurrent thresholds + + #define DRIVER_TYPE_L6474(Q) AXIS_DRIVER_TYPE_##Q(L6474) uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold)) return; // quit if invalid user input - DEBUG_ECHOLNPAIR("feedrate = ", final_fr_mm_m); + DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate); - planner.synchronize(); // Wait for moves to finish + planner.synchronize(); // wait for all current movement commands to complete + const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // Clear out error flags + L64xxManager.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; + uint16_t M91x_counter = kval_hold; + uint16_t M91x_counter_max; + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { + M91x_counter_max = 128; // TVAL is 7 bits + LIMIT(M91x_counter, 0U, 127U); + } + else + M91x_counter_max = 256; // KVAL_HOLD is 8 bits + + uint8_t M91x_delay_s = parser.byteval('D'); // get delay in seconds + millis_t M91x_delay_ms = M91x_delay_s * 60 * 1000; + millis_t M91x_delay_end; + DEBUG_ECHOLNPGM(".\n."); do { - DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold); // set & report KVAL_HOLD for this run + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) + DEBUG_ECHOLNPAIR("TVAL current (mA) = ", (M91x_counter + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV); // report TVAL current for this run + else + DEBUG_ECHOLNPAIR("kval_hold = ", M91x_counter); // report KVAL_HOLD for this run for (j = 0; j < driver_count; j++) - L6470.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); + L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, M91x_counter); //set KVAL_HOLD or TVAL (same register address) - // Turn the motor(s) both directions - jiggle_axis(axis_mon[0][0], position_min, position_max, final_fr_mm_m); + M91x_delay_end = millis() + M91x_delay_ms; + do { + // turn the motor(s) both directions + sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(final_feedrate)); + gcode.process_subcommands_now_P(gcode_string); - status_composite = 0; // clear out the old bits + sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_max), uint16_t(final_feedrate)); + gcode.process_subcommands_now_P(gcode_string); - 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 - status_composite |= axis_status[j] ; - } + // get the status after the motors have stopped + planner.synchronize(); + + status_composite = 0; // clear out the old bits - if (status_composite && (status_composite & STATUS_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]); + axis_status[j] = (~L64xxManager.get_status(axis_index[j])) & sh.L6470_ERROR_MASK; // bits of interest are all active low + status_composite |= axis_status[j] ; } - return; - } - // increment KVAL_HOLD if not yet at thermal warning/shutdown - if (!(status_composite & (STATUS_TH_WRN | STATUS_TH_SD))) - kval_hold++; + if (status_composite) break; + } while (millis() < M91x_delay_end); - } while (!(status_composite & (STATUS_TH_WRN | STATUS_TH_SD)) && kval_hold); // exit when kval_hold == 0 (rolls over) + if (status_composite) break; - DEBUG_ECHOPGM(".\n.\nThermal warning/shutdown "); - if ((status_composite & (STATUS_TH_WRN | STATUS_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]); - } - } - else - DEBUG_ECHOLNPGM("(Unable to get)"); + M91x_counter++; + + } while (!(status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) && (M91x_counter < M91x_counter_max)); DEBUG_ECHOLNPGM("."); + + #if ENABLED(L6470_CHITCHAT) + if (status_composite) { + L64xxManager.error_status_decode(status_composite, axis_index[0], + 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, sh.STATUS_AXIS_LAYOUT); + DEBUG_ECHOLNPGM("."); + } + #endif + + if ((status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD))) + DEBUG_ECHOLNPGM(".\n.\nTest completed normally - Thermal warning/shutdown has occurred"); + else if (status_composite) + DEBUG_ECHOLNPGM(".\n.\nTest completed abnormally - non-thermal error has occured"); + else + DEBUG_ECHOLNPGM(".\n.\nTest completed normally - Unable to get to thermal warning/shutdown"); + + L64xxManager.pause_monitor(false); } /** @@ -159,8 +191,8 @@ void GcodeSuite::M916() { * * Decrease OCD current until overcurrent error * Increase OCD until overcurrent error goes away - * Decrease stall threshold until stall - * Increase stall until stall error goes away + * Decrease stall threshold until stall (not done on L6474) + * Increase stall until stall error goes away (not done on L6474) * * J - select which driver(s) to monitor on multi-driver axis * 0 - (default) monitor all drivers on the axis or E0 @@ -176,7 +208,10 @@ void GcodeSuite::M916() { * optional - will report current value from driver if not specified * if there are multiple drivers on the axis then all will be set the same * - * K - value for KVAL_HOLD (0 - 255) + * T - current (mA) setting for TVAL (0 - 4A in 31.25mA increments, rounds down) - L6474 only + * optional - will report current value from driver if not specified + * + * K - value for KVAL_HOLD (0 - 255) (ignored for L6474) * optional - will report current value from driver if not specified * */ @@ -184,66 +219,85 @@ void GcodeSuite::M917() { DEBUG_ECHOLNPGM("M917"); - char axis_mon[3][3] = { " ", " ", " " }; // list of axes to be monitored - uint8_t axis_index[3]; + L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status + + char axis_mon[3][3] = { {" "}, {" "}, {" "} }; // list of Axes to be monitored + L64XX_axis_t axis_index[3]; uint16_t axis_status[3]; uint8_t driver_count = 1; float position_max; float position_min; - feedRate_t final_fr_mm_m; + 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; + constexpr uint8_t 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_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold)) return; // quit if invalid user input - DEBUG_ECHOLNPAIR("feedrate = ", final_fr_mm_m); + DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate); - planner.synchronize(); // Wait for moves to finish + planner.synchronize(); // wait for all current movement commands to complete + + const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // Clear out error flags + L64xxManager.get_status(axis_index[j]); // clear error flags + char temp_axis_string[] = " "; + temp_axis_string[0] = axis_mon[0][0]; // need a sprintf format string + char gcode_string[80]; uint16_t status_composite = 0; - uint8_t test_phase = 0; - // 0 - decreasing OCD - exit when OCD warning occurs (ignore STALL) - // 1 - increasing OCD - exit when OCD warning stops (ignore STALL) - - // 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); + uint8_t test_phase = 0; // 0 - decreasing OCD - exit when OCD warning occurs (ignore STALL) + // 1 - increasing OCD - exit when OCD warning stops (ignore STALL) + // 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); + if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) { + DEBUG_ECHOPAIR(") Stall threshold: ", (STALL_TH_val + 1) * 31.25); + DEBUG_ECHOPAIR(" (STALL_TH: ", STALL_TH_val); + } DEBUG_ECHOLNPGM(")"); do { - DEBUG_ECHOPAIR("STALL threshold : ", (stall_th_val + 1) * 31.25); - DEBUG_ECHOLNPAIR(" OCD threshold : ", (ocd_th_val + 1) * 375); + if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) DEBUG_ECHOPAIR("STALL threshold : ", (STALL_TH_val + 1) * 31.25); + DEBUG_ECHOLNPAIR(" OCD threshold : ", (OCD_TH_val + 1) * 375); - jiggle_axis(axis_mon[0][0], position_min, position_max, final_fr_mm_m); + sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(final_feedrate)); + gcode.process_subcommands_now_P(gcode_string); + + sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_max), uint16_t(final_feedrate)); + gcode.process_subcommands_now_P(gcode_string); + + planner.synchronize(); 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] = (~L64xxManager.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]); - } + #if ENABLED(L6470_CHITCHAT) + for (j = 0; j < driver_count; j++) { + if (j) DEBUG_ECHOPGM("..."); + L64xxManager.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, sh.STATUS_AXIS_LAYOUT); + } + #endif 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; @@ -251,118 +305,136 @@ void GcodeSuite::M917() { k++; if (!(k % 4)) { kval_hold *= 0.95; - L6470_EOL(); + DEBUG_EOL(); DEBUG_ECHOLNPAIR("Lowering KVAL_HOLD by about 5% to ", kval_hold); for (j = 0; j < driver_count; j++) - L6470.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); + L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); } DEBUG_ECHOLNPGM("."); - reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered - watchdog_refresh(); + gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered + watchdog_refresh();; // beat the dog 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] = (~L64xxManager.get_status(axis_index[j])) & sh.L6470_ERROR_MASK; // bits of interest are all active low status_composite_temp |= axis_status[j]; } } - while (status_composite_temp & (STATUS_TH_WRN | STATUS_TH_SD)); - L6470_EOL(); + while (status_composite_temp & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)); + DEBUG_EOL(); } - if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B | STATUS_OCD)) { + if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B | sh.STATUS_AXIS_OCD)) { switch (test_phase) { case 0: { - if (status_composite & STATUS_OCD) { + if (status_composite & sh.STATUS_AXIS_OCD) { // phase 0 with OCD warning - time to go to next phase - if (ocd_th_val >=15) { - ocd_th_val = 15; // limit to max + if (OCD_TH_val >= sh.AXIS_OCD_TH_MAX) { + OCD_TH_val = sh.AXIS_OCD_TH_MAX; // limit to max test_phase = 2; // at highest value so skip phase 1 - DEBUG_ECHOLNPGM("LOGIC E0A OCD at highest - skip to 2"); + //DEBUG_ECHOLNPGM("LOGIC E0A OCD at highest - skip to 2"); + DEBUG_ECHOLNPGM("OCD at highest - OCD finalized"); } else { - ocd_th_val++; // normal exit to next phase + OCD_TH_val++; // normal exit to next phase test_phase = 1; // setup for first pass of phase 1 - DEBUG_ECHOLNPGM("LOGIC E0B - inc OCD & go to 1"); + //DEBUG_ECHOLNPGM("LOGIC E0B - inc OCD & go to 1"); + DEBUG_ECHOLNPGM("inc OCD"); } } else { // phase 0 without OCD warning - keep on decrementing if can - if (ocd_th_val) { - ocd_th_val--; // try lower value - DEBUG_ECHOLNPGM("LOGIC E0C - dec OCD"); + if (OCD_TH_val) { + OCD_TH_val--; // try lower value + //DEBUG_ECHOLNPGM("LOGIC E0C - dec OCD"); + DEBUG_ECHOLNPGM("dec OCD"); } else { test_phase = 2; // at lowest value without warning so skip phase 1 - DEBUG_ECHOLNPGM("LOGIC E0D - OCD at latest - go to 2"); + //DEBUG_ECHOLNPGM("LOGIC E0D - OCD at latest - go to 2"); + DEBUG_ECHOLNPGM("OCD finalized"); } } } break; case 1: { - if (status_composite & STATUS_OCD) { + if (status_composite & sh.STATUS_AXIS_OCD) { // phase 1 with OCD warning - increment if can - if (ocd_th_val >= 15) { - ocd_th_val = 15; // limit to max + if (OCD_TH_val >= sh.AXIS_OCD_TH_MAX) { + OCD_TH_val = sh.AXIS_OCD_TH_MAX; // limit to max test_phase = 2; // at highest value so go to next phase - DEBUG_ECHOLNPGM("LOGIC E1A - OCD at max - go to 2"); + //DEBUG_ECHOLNPGM("LOGIC E1A - OCD at max - go to 2"); + DEBUG_ECHOLNPGM("OCD finalized"); } else { - ocd_th_val++; // try a higher value - DEBUG_ECHOLNPGM("LOGIC E1B - inc OCD"); + OCD_TH_val++; // try a higher value + //DEBUG_ECHOLNPGM("LOGIC E1B - inc OCD"); + DEBUG_ECHOLNPGM("inc OCD"); } } else { // phase 1 without OCD warning - normal exit to phase 2 test_phase = 2; - DEBUG_ECHOLNPGM("LOGIC E1C - no OCD warning - go to 1"); + //DEBUG_ECHOLNPGM("LOGIC E1C - no OCD warning - go to 1"); + DEBUG_ECHOLNPGM("OCD finalized"); } } break; case 2: { - if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) { + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // skip all STALL_TH steps if L6474 + test_phase = 4; + break; + } + 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 - DEBUG_ECHOLNPGM("LOGIC E2A - STALL warning, STALL at max, quit"); + 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 - DEBUG_ECHOLNPGM("LOGIC E2B - INC - STALL warning, inc Stall, go to 3"); + STALL_TH_val++; // setup for first pass of phase 3 + //DEBUG_ECHOLNPGM("LOGIC E2B - INC - STALL warning, inc Stall, go to 3"); + DEBUG_ECHOLNPGM("inc Stall"); } } else { // phase 2 without stall warning - decrement if can - if (stall_th_val) { - stall_th_val--; // try a lower value - DEBUG_ECHOLNPGM("LOGIC E2C - no STALL, dec STALL"); + if (STALL_TH_val) { + STALL_TH_val--; // try a lower value + //DEBUG_ECHOLNPGM("LOGIC E2C - no STALL, dec STALL"); + DEBUG_ECHOLNPGM("dec STALL"); } else { DEBUG_ECHOLNPGM("finished - STALL at lowest value but still do NOT have stall warning"); test_phase = 4; - DEBUG_ECHOLNPGM("LOGIC E2D - no STALL, at lowest so quit"); + //DEBUG_ECHOLNPGM("LOGIC E2D - no STALL, at lowest so quit"); } } } break; case 3: { - if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) { + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // skip all STALL_TH steps if L6474 + test_phase = 4; + break; + } + 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"); + //DEBUG_ECHOLNPGM("LOGIC E3A - STALL, at max so quit"); } else { - stall_th_val++; // still looking for passing value - DEBUG_ECHOLNPGM("LOGIC E3B - STALL, inc stall"); + STALL_TH_val++; // still looking for passing value + //DEBUG_ECHOLNPGM("LOGIC E3B - STALL, inc stall"); + DEBUG_ECHOLNPGM("inc stall"); } } else { //phase 3 without stall warning but have OCD warning DEBUG_ECHOLNPGM("Hardware problem - OCD warning without STALL warning"); test_phase = 4; - DEBUG_ECHOLNPGM("LOGIC E3C - not STALLED, hardware problem (quit)"); + //DEBUG_ECHOLNPGM("LOGIC E3C - not STALLED, hardware problem (quit)"); } } break; @@ -372,58 +444,81 @@ 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 - DEBUG_ECHOLNPGM("LOGIC N0A - DEC OCD"); + if (OCD_TH_val) { + OCD_TH_val--; // try lower value + //DEBUG_ECHOLNPGM("LOGIC N0A - DEC OCD"); + DEBUG_ECHOLNPGM("DEC OCD"); } else { test_phase = 2; // at lowest value without warning so skip phase 1 - DEBUG_ECHOLNPGM("LOGIC N0B - OCD at lowest (go to phase 2)"); + //DEBUG_ECHOLNPGM("LOGIC N0B - OCD at lowest (go to phase 2)"); + DEBUG_ECHOLNPGM("OCD finalized"); } } break; - case 1: DEBUG_ECHOLNPGM("LOGIC N1 (go directly to 2)"); // phase 1 without OCD warning - drop directly to phase 2 + case 1: //DEBUG_ECHOLNPGM("LOGIC N1 (go directly to 2)"); // phase 1 without OCD warning - drop directly to phase 2 + DEBUG_ECHOLNPGM("OCD finalized"); 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) - DEBUG_ECHOLNPGM("LOGIC N2B - dec STALL"); + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // skip all STALL_TH steps if L6474 + test_phase = 4; + break; + } + if (STALL_TH_val) { + STALL_TH_val--; // try a lower value (stay in phase 2) + //DEBUG_ECHOLNPGM("LOGIC N2B - dec STALL"); + DEBUG_ECHOLNPGM("dec STALL"); } else { DEBUG_ECHOLNPGM("finished - STALL at lowest value but still no stall warning"); test_phase = 4; - DEBUG_ECHOLNPGM("LOGIC N2C - STALL at lowest (quit)"); + //DEBUG_ECHOLNPGM("LOGIC N2C - STALL at lowest (quit)"); } } break; - case 3: { test_phase = 4; - DEBUG_ECHOLNPGM("LOGIC N3 - finished!"); + case 3: { + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // skip all STALL_TH steps if L6474 + test_phase = 4; + break; + } + test_phase = 4; + //DEBUG_ECHOLNPGM("LOGIC N3 - finished!"); + DEBUG_ECHOLNPGM("finished!"); } break; // phase 3 without any warnings - desired exit } // } // end of status checks 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"); + L64xxManager.set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val); + if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) L64xxManager.set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val); + if (L64xxManager.get_param(axis_index[j], L6470_OCD_TH) != OCD_TH_val) DEBUG_ECHOLNPGM("OCD mismatch"); + if ((L64xxManager.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) && (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT)) DEBUG_ECHOLNPGM("STALL mismatch"); } } } while (test_phase != 4); + DEBUG_ECHOLNPGM("."); if (status_composite) { + #if ENABLED(L6470_CHITCHAT) + for (j = 0; j < driver_count; j++) { + if (j) DEBUG_ECHOPGM("..."); + L64xxManager.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, sh.STATUS_AXIS_LAYOUT); + } + DEBUG_ECHOLNPGM("."); + #endif DEBUG_ECHOLNPGM("Completed with errors"); - for (j = 0; j < driver_count; j++) { - DEBUG_ECHOPGM("..."); - L6470.error_status_decode(axis_status[j], axis_index[j]); - } } else DEBUG_ECHOLNPGM("Completed with no errors"); + DEBUG_ECHOLNPGM("."); -} // M917 + L64xxManager.pause_monitor(false); +} /** * @@ -439,7 +534,13 @@ void GcodeSuite::M917() { * I - over current threshold * optional - will report current value from driver if not specified * - * K - value for KVAL_HOLD (0 - 255) (optional) + * T - current (mA) setting for TVAL (0 - 4A in 31.25mA increments, rounds down) - L6474 only + * optional - will report current value from driver if not specified + * + * K - value for KVAL_HOLD (0 - 255) (ignored for L6474) + * optional - will report current value from driver if not specified + * + * M - value for microsteps (1 - 128) (optional) * optional - will report current value from driver if not specified * */ @@ -447,83 +548,109 @@ void GcodeSuite::M918() { DEBUG_ECHOLNPGM("M918"); - char axis_mon[3][3] = { " ", " ", " " }; // List of axes to monitor - uint8_t axis_index[3]; + L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status + + char axis_mon[3][3] = { {" "}, {" "}, {" "} }; // list of Axes to be monitored + L64XX_axis_t axis_index[3]; uint16_t axis_status[3]; uint8_t driver_count = 1; float position_max, position_min; - feedRate_t final_fr_mm_m; + 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; + constexpr uint8_t over_current_flag = true; + + const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L64xxManager.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 + L64xxManager.get_status(axis_index[0]); // populate shadow array + uint8_t m_steps = parser.byteval('M'); - LIMIT(m_steps, 0, 128); - DEBUG_ECHOLNPAIR("M = ", m_steps); - int8_t m_bits = -1; - if (m_steps > 85) m_bits = 7; // 128 (no synch output) - else if (m_steps > 42) m_bits = 6; // 64 (no synch output) - else if (m_steps > 22) m_bits = 5; // 32 (no synch output) - else if (m_steps > 12) m_bits = 4; // 16 (no synch output) - else if (m_steps > 5) m_bits = 3; // 8 (no synch output) - else if (m_steps > 2) m_bits = 2; // 4 (no synch output) - else if (m_steps == 2) m_bits = 1; // 2 (no synch output) - else if (m_steps == 1) m_bits = 0; // 1 (no synch output) - else if (m_steps == 0) m_bits = 7; // 128 (no synch output) + if (m_steps != 0) { + LIMIT(m_steps, 1, sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT ? 16 : 128); // L6474 - if (m_bits >= 0) { - const int micros = _BV(m_bits); - if (micros < 100) { DEBUG_CHAR(' '); if (micros < 10) DEBUG_CHAR(' '); } - DEBUG_ECHO(micros); - DEBUG_ECHOPGM(" uSTEPS"); - } + uint8_t stepVal; + for (stepVal = 0; stepVal < 8; stepVal++) { // convert to L64xx register value + if (m_steps == 1) break; + m_steps >>= 1; + } - for (j = 0; j < driver_count; j++) - L6470.set_param(axis_index[j], L6470_STEP_MODE, m_bits); // set microsteps - - DEBUG_ECHOLNPAIR("target (maximum) feedrate = ", final_fr_mm_m); - - planner.synchronize(); // Wait for moves to finish - - for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // Clear all error flags - - uint16_t status_composite = 0; - DEBUG_ECHOLNPGM(".\n.\n."); // Make the feedrate prints easier to see - - constexpr uint8_t iterations = 10; - for (uint8_t i = 1; i <= iterations; i++) { - const feedRate_t fr_mm_m = i * final_fr_mm_m / iterations; - DEBUG_ECHOLNPAIR("...feedrate = ", fr_mm_m); - - jiggle_axis(axis_mon[0][0], position_min, position_max, fr_mm_m); + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) + stepVal |= 0x98; // NO SYNC + else + stepVal |= (!SYNC_EN) | SYNC_SEL_1 | stepVal; for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L6470.get_status(axis_index[j])) & 0x0800; // bits of interest are all active low + L64xxManager.set_param(axis_index[j], dSPIN_HARD_HIZ, 0); // can't write STEP register if stepper being powered + // results in an extra NOOP being sent (data 00) + L64xxManager.set_param(axis_index[j], L6470_STEP_MODE, stepVal); // set microsteps + } + } + m_steps = L64xxManager.get_param(axis_index[0], L6470_STEP_MODE) & 0x07; // get microsteps + + DEBUG_ECHOLNPAIR("Microsteps = ", _BV(m_steps)); + DEBUG_ECHOLNPAIR("target (maximum) feedrate = ", final_feedrate); + + const float feedrate_inc = final_feedrate / 10, // Start at 1/10 of max & go up by 1/10 per step + fr_limit = final_feedrate * 0.99f; // Rounding-safe comparison value + float current_feedrate = 0; + + planner.synchronize(); // Wait for moves to complete + + for (j = 0; j < driver_count; j++) + L64xxManager.get_status(axis_index[j]); // Clear error flags + + char temp_axis_string[2] = " "; + temp_axis_string[0] = axis_mon[0][0]; // Need a sprintf format string + //temp_axis_string[1] = '\n'; + + char gcode_string[80]; + uint16_t status_composite = 0; + DEBUG_ECHOLNPGM(".\n.\n."); // Make feedrate outputs easier to read + + do { + current_feedrate += feedrate_inc; + DEBUG_ECHOLNPAIR("...feedrate = ", current_feedrate); + + sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(current_feedrate)); + gcode.process_subcommands_now_P(gcode_string); + + sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_max), uint16_t(current_feedrate)); + gcode.process_subcommands_now_P(gcode_string); + + planner.synchronize(); + + for (j = 0; j < driver_count; j++) { + axis_status[j] = (~L64xxManager.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 - } + if (status_composite) break; // Break on any error + } while (current_feedrate < fr_limit); - 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]); - } + #if ENABLED(L6470_CHITCHAT) + for (j = 0; j < driver_count; j++) { + if (j) DEBUG_ECHOPGM("..."); + L64xxManager.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, sh.STATUS_AXIS_LAYOUT); + } + #endif } else DEBUG_ECHOLNPGM("no errors"); -} // M918 + L64xxManager.pause_monitor(false); +} -#endif // HAS_DRIVER(L6470) +#endif // HAS_L64XX diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index fad5b80822..860e8c3552 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -786,7 +786,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #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 9f4675291f..468f44cbea 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -896,7 +896,7 @@ private: #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 17356933fe..c0d173a0ad 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 "../../libs/L6470/L6470_Marlin.h" + #if HAS_L64XX + #include "../../libs/L64XX/L64XX_Marlin.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../core/debug_out.h" #endif @@ -88,13 +86,13 @@ planner.synchronize(); - #if HAS_DRIVER(L6470) + #if HAS_L64XX char temp_buf[80]; int32_t temp; //#define ABS_POS_SIGN_MASK 0b1111 1111 1110 0000 0000 0000 0000 0000 #define ABS_POS_SIGN_MASK 0b11111111111000000000000000000000 #define REPORT_ABSOLUTE_POS(Q) do{ \ - L6470.say_axis(Q, false); \ + L64xxManager.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); \ @@ -102,47 +100,47 @@ }while(0) DEBUG_ECHOPGM("\nL6470:"); - #if AXIS_DRIVER_TYPE_X(L6470) + #if AXIS_IS_L64XX(X) REPORT_ABSOLUTE_POS(X); #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #if AXIS_IS_L64XX(X2) REPORT_ABSOLUTE_POS(X2); #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #if AXIS_IS_L64XX(Y) REPORT_ABSOLUTE_POS(Y); #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #if AXIS_IS_L64XX(Y2) REPORT_ABSOLUTE_POS(Y2); #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #if AXIS_IS_L64XX(Z) REPORT_ABSOLUTE_POS(Z); #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #if AXIS_IS_L64XX(Z2) REPORT_ABSOLUTE_POS(Z2); #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #if AXIS_IS_L64XX(Z3) REPORT_ABSOLUTE_POS(Z3); #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #if AXIS_IS_L64XX(E0) REPORT_ABSOLUTE_POS(E0); #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #if AXIS_IS_L64XX(E1) REPORT_ABSOLUTE_POS(E1); #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #if AXIS_IS_L64XX(E2) REPORT_ABSOLUTE_POS(E2); #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #if AXIS_IS_L64XX(E3) REPORT_ABSOLUTE_POS(E3); #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #if AXIS_IS_L64XX(E4) REPORT_ABSOLUTE_POS(E4); #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #if AXIS_IS_L64XX(E5) REPORT_ABSOLUTE_POS(E5); #endif SERIAL_EOL(); - #endif // HAS_DRIVER(L6470) + #endif // HAS_L64XX SERIAL_ECHOPGM("Stepper:"); LOOP_XYZE(i) { diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 2473e8c7e8..c21bdefb1f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2145,7 +2145,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers." #endif -#define IN_CHAIN(A) (A##_CHAIN_POS > 0) +#define IN_CHAIN(A) ((A##_CHAIN_POS > 0) && !HAS_L64XX) // TMC SPI Chaining #if IN_CHAIN(X) || IN_CHAIN(Y) || IN_CHAIN(Z) || IN_CHAIN(X2) || IN_CHAIN(Y2) || IN_CHAIN(Z2) || IN_CHAIN(Z3) || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5) #if (IN_CHAIN(X) && !PIN_EXISTS(X_CS) ) || (IN_CHAIN(Y) && !PIN_EXISTS(Y_CS) ) \ diff --git a/Marlin/src/libs/L6470/000_l6470_read_me.md b/Marlin/src/libs/L6470/000_l6470_read_me.md deleted file mode 100644 index 712ced551b..0000000000 --- a/Marlin/src/libs/L6470/000_l6470_read_me.md +++ /dev/null @@ -1,105 +0,0 @@ -Arduino-6470 library revision 0.7.0 or above is required. - -This software can be used with any L647x chip and the powerSTEP01. L647x and powerSTEP01 devices can not be mixed within a system. A flag in the library must be set to enable use of a powerSTEP01. - -These devices use voltage PWMs to drive the stepper phases. Phase current is not directly controlled. Each microstep corresponds to a particular PWM duty cycle. The KVAL\_HOLD register scales the PWM duty cycle. - -This software assumes that all L6470 drivers are in one SPI daisy chain. - -``` - The hardware setup is: - - MOSI from controller tied to SDI on the first device - - SDO of the first device is tied to SDI of the next device - - SDO of the last device is tied to MISO of the controller - - all devices share the same SCK, SS\_PIN and RESET\_PIN - - Each L6470 passes the data it saw on its SDI to its neighbor on the **NEXT** SPI cycle (8 bit delay). - - Each L6470 acts on the **last** SPI data it saw when the SS\_PIN **goes high**. -``` - -The L6470 drivers operate in STEP\_CLOCK mode. In this mode the direction and enable are done via SPI commands and the phase currents are changed in response to step pulses (generated in the usual way). - -There are two different SPI routines used. - -- **uint8\_t** L6470\_Transfer(uint8\_t data, int \_SSPin, const uint8\_t chain\_position) is used to setup the chips and by the maintenance/status code. This code uses the Arduino-6470 library. - -- **void** L6470\_Transfer(uint8\_t L6470\_buf[], const uint8\_t length) is used by the set\_directions() routine to send the direction/enable commands. The library is NOT used by this code. - -**HARDWARE/SOFTWARE interaction** - -Powering up a stepper and setting the direction are done by the same command. Can't do one without the other. - -**All** directions are set **every time** a new block is popped off the queue by the stepper ISR. - -SPI transfers, when setting the directions, are minimized by using arrays and a SPI routine dedicated to this function. L6470 library calls are not used. For N L6470 drivers, this results in a N byte transfer. If library calls were used then N\*N bytes would be sent. - -**Power up (reset) sequence:** - -1. Stepper objects are created before the **setup()** entry point is reached. - -2. After the **setup()** entry point is reached and before the steppers are initialized, L6470\_init() is called to do the following - -3. If present, the hardware reset is pulsed. - -4. The L6470\_chain array is populated during **setup()**. This array is used to tell where in the SPI stream the commands/data for an stepper is positioned. - -5. The L6470 soft SPI pins are initialized. - -6. The L6470 chips are initialized during **setup()**. They can be re-initialized using the **L6470\_init\_to\_defaults()** function - -The steppers are **NOT** powered up during this sequence. - -**L6470\_chain** array - -This array is used by all routines that transmit SPI data. - -``` - Location 0 - number of drivers in chain - - Location 1 - axis index for first device in the chain (closest to MOSI) - - ... - - Location N - axis index for last device in the N device long chain (closest to MISO) -``` - -**Direction set and enable** - -The DIR\_WRITE macros for the L6470 drivers are written so that the standard X, Y, Z and extruder logic used by the set\_directions() routine is not altered. These macros write the correct forward/reverse command to the corresponding location in the array *L6470\_dir\_commands*. - -At the end of the set\_directions() routine, the array *L6470\_chain* is used to grab the corresponding direction/enable commands out of the array *L6470\_dir\_commands* and put them in the correct sequence in the array *L6470\_buf*. Array *L6470\_buf* is then passed to the **void** L6470\_Transfer function which actually sends the data to the devices. - -**Utilities and misc** - -The **absolute position** registers should accurately reflect Marlin’s stepper position counts. They are set to zero during initialization. G28 sets them to the Marlin counts for the corresponding axis after homing. NOTE – these registers are often the negative of the Marlin counts. This is because the Marlin counts reflect the logical direction while the registers reflect the stepper direction. The register contents are displayed via the M114 D command. - -The **L6470\_monitor** feature reads the status of each device every half second. It will report if there are any error conditions present or if communications has been lost/restored. The KVAL\_HOLD value is reduced every 2 – 2.5 seconds if the thermal warning or thermal shutdown conditions are present. - -**M122** displays the settings of most of the bits in the status register plus a couple of other items. - -**M906** can be used to set the KVAL\_HOLD register one driver at a time. If a setting is not included with the command then the contents of the registers that affect the phase current/voltage are displayed. - -**M916, M917 & M918** - -These utilities are used to tune the system. They can get you in the ballpark for acceptable jerk, acceleration, top speed and KVAL\_HOLD settings. In general they seem to provide an overly optimistic KVAL\_HOLD setting because of the lag between setting KVAL\_HOLD and the driver reaching final temperature. Enabling the **L6470\_monitor** feature during prints will provide the **final useful KVAL\_HOLD setting**. - -The amount of power needed to move the stepper without skipping steps increases as jerk, acceleration and top speed increase. The power dissipated by the driver increases as the power to the stepper increases. The net result is a balancing act between jerk, acceleration, top speed and power dissipated by the driver. - -**M916 -** Increases KVAL\_HOLD while moving one axis until get thermal warning. 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. - -**M917 -** Find minimum current thresholds. This is done by doing the following steps while moving an axis: - -1. Decrease OCD current until overcurrent error - -2. Increase OCD until overcurrent error goes away - -3. Decrease stall threshold until stall error - -4. Increase stall until stall error goes away - -**M918 -** Increase speed until error or max feedrate achieved. diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp deleted file mode 100644 index 90dd38a614..0000000000 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ /dev/null @@ -1,793 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * The monitor_driver routines are a close copy of the TMC code - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_DRIVER(L6470) - -#include "L6470_Marlin.h" - -L6470_Marlin L6470; - -#include "../../module/stepper/indirection.h" -#include "../../module/planner.h" -#include "../../gcode/gcode.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 - -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 -}; - -volatile bool L6470_Marlin::spi_abort = false; -bool L6470_Marlin::spi_active = false; - -void L6470_Marlin::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) - _L6470_INIT_SPI(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_INIT_SPI(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_INIT_SPI(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_INIT_SPI(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_INIT_SPI(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_INIT_SPI(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_INIT_SPI(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_INIT_SPI(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_INIT_SPI(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_INIT_SPI(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_INIT_SPI(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_INIT_SPI(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - _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 - delay(1); - OUT_WRITE(L6470_RESET_CHAIN_PIN, HIGH); - 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 -} - -uint16_t L6470_Marlin::get_status(const uint8_t axis) { - - #define GET_L6470_STATUS(Q) stepper##Q.getStatus() - - switch (axis) { - #if AXIS_DRIVER_TYPE_X(L6470) - case 0: return GET_L6470_STATUS(X); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - case 1: return GET_L6470_STATUS(Y); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - case 2: return GET_L6470_STATUS(Z); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - case 3: return GET_L6470_STATUS(X2); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - case 4: return GET_L6470_STATUS(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - case 5: return GET_L6470_STATUS(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - case 6: return GET_L6470_STATUS(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - case 7: return GET_L6470_STATUS(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 8: return GET_L6470_STATUS(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 9: return GET_L6470_STATUS(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 10: return GET_L6470_STATUS(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 11: return GET_L6470_STATUS(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 12: return GET_L6470_STATUS(E5); - #endif - } - - return 0; // Not needed but kills a compiler warning -} - -uint32_t L6470_Marlin::get_param(uint8_t axis, 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); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - case 1: return GET_L6470_PARAM(Y); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - case 2: return GET_L6470_PARAM(Z); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - case 3: return GET_L6470_PARAM(X2); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - case 4: return GET_L6470_PARAM(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - case 5: return GET_L6470_PARAM(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - case 6: return GET_L6470_PARAM(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - case 7: return GET_L6470_PARAM(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 8: return GET_L6470_PARAM(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 9: return GET_L6470_PARAM(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 10: return GET_L6470_PARAM(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 11: return GET_L6470_PARAM(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 12: 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) { - - #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value) - - switch (axis) { - #if AXIS_DRIVER_TYPE_X(L6470) - case 0: SET_L6470_PARAM(X); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - case 1: SET_L6470_PARAM(Y); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - case 2: SET_L6470_PARAM(Z); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - case 3: SET_L6470_PARAM(X2); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - case 4: SET_L6470_PARAM(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - case 5: SET_L6470_PARAM(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - case 6: SET_L6470_PARAM(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - case 7: SET_L6470_PARAM(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - case 8: SET_L6470_PARAM(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - case 9: SET_L6470_PARAM(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - case 10: SET_L6470_PARAM(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - case 11: SET_L6470_PARAM(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - case 12: SET_L6470_PARAM(E5); - #endif - } -} - -inline void echo_min_max(const char a, const float &min, const float &max) { - DEBUG_CHAR(' '); DEBUG_CHAR(a); - DEBUG_ECHOPAIR(" min = ", min); - DEBUG_ECHOLNPAIR(" max = ", max); -} -inline void echo_oct_used(const float &oct, const bool stall) { - DEBUG_ECHOPAIR("over_current_threshold used : ", oct); - serialprintPGM(stall ? PSTR(" (Stall") : PSTR(" (OCD")); - DEBUG_ECHOLNPGM(" threshold)"); -} -inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("ERROR - motion out of bounds"); } - -bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], char axis_mon[3][3], - float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, - bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold -) { - // Return TRUE if the calling routine needs to abort/kill - - uint16_t displacement = 0; // " = 0" to eliminate compiler warning - uint8_t j; // general purpose counter - - if (!all_axes_homed()) { - DEBUG_ECHOLNPGM("ERROR - home all before running this command"); - //return true; - } - - LOOP_XYZE(i) if (uint16_t _displacement = parser.intval(axis_codes[i])) { - displacement = _displacement; - uint8_t axis_offset = parser.byteval('J'); - 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 - driver_count_local++; - } - driver_count = driver_count_local; - } - break; // only take first axis found - } - - // - // Position calcs & checks - // - - const xyze_pos_t center = { - LOGICAL_X_POSITION(current_position.x), - LOGICAL_Y_POSITION(current_position.y), - LOGICAL_Z_POSITION(current_position.z), - current_position.e - }; - - switch (axis_mon[0][0]) { - default: position_max = position_min = 0; break; - - case 'X': { - position_min = center.x - displacement; - position_max = center.x + displacement; - echo_min_max('X', position_min, position_max); - if (false - #ifdef X_MIN_POS - || position_min < (X_MIN_POS) - #endif - #ifdef X_MAX_POS - || position_max > (X_MAX_POS) - #endif - ) { - err_out_of_bounds(); - return true; - } - } break; - - case 'Y': { - position_min = center.y - displacement; - position_max = center.y + displacement; - echo_min_max('Y', position_min, position_max); - if (false - #ifdef Y_MIN_POS - || position_min < (Y_MIN_POS) - #endif - #ifdef Y_MAX_POS - || position_max > (Y_MAX_POS) - #endif - ) { - err_out_of_bounds(); - return true; - } - } break; - - case 'Z': { - position_min = center.z - displacement; - position_max = center.z + displacement; - echo_min_max('Z', position_min, position_max); - if (false - #ifdef Z_MIN_POS - || position_min < (Z_MIN_POS) - #endif - #ifdef Z_MAX_POS - || position_max > (Z_MAX_POS) - #endif - ) { - err_out_of_bounds(); - return true; - } - } break; - - case 'E': { - position_min = center.e - displacement; - position_max = center.e + displacement; - echo_min_max('E', position_min, position_max); - } break; - } - - // - // Work on the drivers - // - 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]]; - if (ind_axis[0] == axis_mon[k][0] && ind_axis[1] == axis_mon[k][1]) { // See if a L6470 driver - not_found = false; - break; - } - } - if (not_found) { - driver_count = k; - axis_mon[k][0] = ' '; // mark this entry invalid - break; - } - } - - if (driver_count == 0) { - DEBUG_ECHOLNPGM("ERROR - not a L6470 axis"); - return true; - } - - DEBUG_ECHOPGM("Monitoring:"); - for (j = 0; j < driver_count; j++) DEBUG_ECHOPAIR(" ", axis_mon[j]); - L6470_EOL(); - - // now have a list of driver(s) to monitor - - // - // kVAL_HOLD checks & settings - // - - kval_hold = parser.byteval('K'); - if (kval_hold) { - DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold); - for (j = 0; j < driver_count; j++) - set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); - } - else { - // only print the KVAL_HOLD from one of the drivers - kval_hold = get_param(axis_index[0], L6470_KVAL_HOLD); - DEBUG_ECHOLNPAIR("KVAL_HOLD = ", kval_hold); - } - - // - // Overcurrent checks & settings - // - - if (over_current_flag) { - - uint8_t OCD_TH_val_local = 0, // compiler thinks OCD_TH_val is unused if use it directly - STALL_TH_val_local = 0; // just in case ... - - over_current_threshold = parser.intval('I'); - - if (over_current_threshold) { - - OCD_TH_val_local = over_current_threshold/375; - LIMIT(OCD_TH_val_local, 0, 15); - STALL_TH_val_local = over_current_threshold/31.25; - LIMIT(STALL_TH_val_local, 0, 127); - uint16_t OCD_TH_actual = (OCD_TH_val_local + 1) * 375, - STALL_TH_actual = (STALL_TH_val_local + 1) * 31.25; - if (OCD_TH_actual < STALL_TH_actual) { - OCD_TH_val_local++; - OCD_TH_actual = (OCD_TH_val_local + 1) * 375; - } - - DEBUG_ECHOLNPAIR("over_current_threshold specified: ", over_current_threshold); - echo_oct_used(STALL_TH_actual, true); - echo_oct_used(OCD_TH_actual, false); - - #define SET_OVER_CURRENT(Q) do { stepper##Q.SetParam(L6470_STALL_TH, STALL_TH_val_local); stepper##Q.SetParam(L6470_OCD_TH, OCD_TH_val_local);} while (0) - - for (j = 0; j < driver_count; j++) { - set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local); - set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local); - } - } - else { - // only get & print the OVER_CURRENT values from one of the drivers - STALL_TH_val_local = get_param(axis_index[0], L6470_STALL_TH); - OCD_TH_val_local = get_param(axis_index[0], L6470_OCD_TH); - - echo_oct_used((STALL_TH_val_local + 1) * 31.25, true); - echo_oct_used((OCD_TH_val_local + 1) * 375, false); - } // over_current_threshold - - for (j = 0; j < driver_count; j++) { // set all drivers on axis the same - set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local); - set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local); - } - - OCD_TH_val = OCD_TH_val_local; // force compiler to update the main routine's copy - STALL_TH_val = STALL_TH_val_local; // force compiler to update the main routine's copy - } // end of overcurrent - - // - // Feedrate - // - - final_feedrate = parser.floatval('F'); - if (final_feedrate == 0) { - static constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE; - const uint8_t num_feedrates = COUNT(default_max_feedrate); - for (j = 0; j < num_feedrates; j++) { - if (axis_codes[j] == axis_mon[0][0]) { - final_feedrate = default_max_feedrate[j]; - break; - } - } - if (j == 3 && num_feedrates > 4) { // have more than one extruder feedrate - uint8_t extruder_num = axis_mon[0][1] - '0'; - if (j <= num_feedrates - extruder_num) // have a feedrate specifically for this extruder - final_feedrate = default_max_feedrate[j + extruder_num]; - else - final_feedrate = default_max_feedrate[3]; // use E0 feedrate for this extruder - } - final_feedrate *= 60; // convert to mm/minute - } // end of feedrate - - return false; // FALSE indicates no user input problems -} - -#if ENABLED(L6470_CHITCHAT) - 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*/) { - if (label) SERIAL_ECHOPGM("AXIS:"); - SERIAL_CHAR(' ', index_to_axis[axis][0], index_to_axis[axis][1], ' '); -} - -void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis) { // assumes status bits have been inverted - #if ENABLED(L6470_CHITCHAT) - char temp_buf[10]; - say_axis(axis); - sprintf_P(temp_buf, PSTR(" %4x "), status); - DEBUG_ECHO(temp_buf); - print_bin(status); - DEBUG_ECHOPGM(" THERMAL: "); - serialprintPGM((status & STATUS_TH_SD) ? PSTR("SHUTDOWN") : (status & STATUS_TH_WRN) ? PSTR("WARNING ") : PSTR("OK ")); - DEBUG_ECHOPGM(" OVERCURRENT: "); - echo_yes_no(status & STATUS_OCD); - DEBUG_ECHOPGM(" STALL: "); - echo_yes_no(status & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)); - L6470_EOL(); - #else - UNUSED(status); UNUSED(axis); - #endif -} - -////////////////////////////////////////////////////////////////////////////////////////////////// -//// -//// MONITOR_L6470_DRIVER_STATUS routines -//// -////////////////////////////////////////////////////////////////////////////////////////////////// - -#if ENABLED(MONITOR_L6470_DRIVER_STATUS) - - struct L6470_driver_data { - uint8_t driver_index; - uint32_t driver_status; - bool is_otw; - uint8_t otw_counter; - bool is_ot; - bool is_hi_Z; - uint8_t com_counter; - }; - - L6470_driver_data driver_L6470_data[] = { - #if AXIS_DRIVER_TYPE_X(L6470) - { 0, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - { 1, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - { 2, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - { 3, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - { 4, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - { 5, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - { 6, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - { 7, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - { 8, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - { 9, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - { 10, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - { 11, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - { 12, 0, 0, 0, 0, 0, 0 } - #endif - }; - - inline void append_stepper_err(char * &p, const uint8_t stepper_index, const char * const err=nullptr) { - 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); - } - - void L6470_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 - if (driver_L6470_data[j].driver_index == stepper_index) break; - - driver_L6470_data[j].driver_status = status; - uint16_t _status = ~status; // all error bits are active low - - if (status == 0 || status == 0xFFFF) { // com problem - if (driver_L6470_data[j].com_counter == 0) { // warn user when it first happens - driver_L6470_data[j].com_counter++; - append_stepper_err(p, stepper_index, PSTR(" - communications lost\n")); - DEBUG_ECHO(temp_buf); - } - else { - driver_L6470_data[j].com_counter++; - if (driver_L6470_data[j].com_counter > 240) { // remind of com problem about every 2 minutes - driver_L6470_data[j].com_counter = 1; - append_stepper_err(p, stepper_index, PSTR(" - still no communications\n")); - DEBUG_ECHO(temp_buf); - } - } - } - else { - if (driver_L6470_data[j].com_counter) { // comms re-established - driver_L6470_data[j].com_counter = 0; - append_stepper_err(p, stepper_index, PSTR(" - communications re-established\n.. setting all drivers to default values\n")); - DEBUG_ECHO(temp_buf); - init_to_defaults(); - } - else { - // no com problems - do the usual checks - if (_status & L6470_ERROR_MASK) { - append_stepper_err(p, stepper_index); - - 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 - 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; - set_param(stepper_index, L6470_KVAL_HOLD, kval_hold); // reduce KVAL_HOLD - p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), 2 * KVAL_HOLD_STEP_DOWN, kval_hold); // let user know - } - else - driver_L6470_data[j].is_ot = false; - } - else { - driver_L6470_data[j].is_hi_Z = false; - - if (_status & STATUS_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); - if (driver_L6470_data[j].otw_counter > 4) { // otw present for 2 - 2.5 seconds, reduce KVAL_HOLD - kval_hold -= KVAL_HOLD_STEP_DOWN; - set_param(stepper_index, L6470_KVAL_HOLD, kval_hold); // reduce KVAL_HOLD - p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), KVAL_HOLD_STEP_DOWN, kval_hold); // let user know - driver_L6470_data[j].otw_counter = 0; - driver_L6470_data[j].is_otw = true; - } - else if (driver_L6470_data[j].otw_counter) - p += sprintf_P(p, PSTR("%c- thermal warning"), ' '); // warn user - } - } - - #ifdef L6470_STOP_ON_ERROR - if (_status & (STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD)) - kill(temp_buf); - #endif - - - #if ENABLED(L6470_CHITCHAT) - - if (_status & STATUS_OCD) - p += sprintf_P(p, PSTR("%c over current"), ' '); - - 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"), ' '); - - p += sprintf_P(p, PSTR("%c\n"), ' '); - #endif - - DEBUG_ECHOLN(temp_buf); // print the error message - } - else { - 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()) - - void L6470_Marlin::monitor_driver() { - static millis_t next_cOT = 0; - if (ELAPSED(millis(), next_cOT)) { - next_cOT = millis() + 500; - - spi_active = true; // let set_directions() know we're in the middle of a series of SPI transfers - - #if AXIS_DRIVER_TYPE_X(L6470) - MONITOR_L6470_DRIVE(X); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - MONITOR_L6470_DRIVE(Y); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - MONITOR_L6470_DRIVE(Z); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - MONITOR_L6470_DRIVE(X2); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - MONITOR_L6470_DRIVE(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - MONITOR_L6470_DRIVE(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - MONITOR_L6470_DRIVE(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - MONITOR_L6470_DRIVE(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - MONITOR_L6470_DRIVE(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - MONITOR_L6470_DRIVE(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - MONITOR_L6470_DRIVE(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - MONITOR_L6470_DRIVE(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - MONITOR_L6470_DRIVE(E5); - #endif - - #if ENABLED(L6470_DEBUG) - if (report_L6470_status) L6470_EOL(); - #endif - - spi_active = false; // done with all SPI transfers - clear handshake flags - spi_abort = false; - } - } - -#endif // MONITOR_L6470_DRIVER_STATUS - -#endif // HAS_DRIVER(L6470) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h deleted file mode 100644 index bc9a033e4a..0000000000 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include "../../inc/MarlinConfig.h" - -#include - -#define L6470_GETPARAM(P,Q) stepper##Q.GetParam(P) - -enum L6470_driver_enum : unsigned char { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5, MAX_L6470 }; - -#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 - -class L6470_Marlin { -public: - static bool index_to_dir[MAX_L6470]; - static uint8_t axis_xref[MAX_L6470]; - static char index_to_axis[MAX_L6470][3]; - static 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() {} - - static uint16_t get_status(const uint8_t axis); - - static uint32_t get_param(uint8_t axis, uint8_t param); - - static void set_param(uint8_t axis, uint8_t param, uint32_t value); - - 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 void error_status_decode(const uint16_t status, const uint8_t axis); - - static void monitor_driver(); - - static void init(); - static void init_to_defaults(); - - static void say_axis(const uint8_t axis, const bool label=true); - -private: - void populate_chain_array(); -}; - -extern L6470_Marlin L6470; diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp new file mode 100644 index 0000000000..f1396ada42 --- /dev/null +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -0,0 +1,892 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * The monitor_driver routines are a close copy of the TMC code + */ + +#include "../../inc/MarlinConfig.h" + +#if HAS_L64XX + +#include "L64XX_Marlin.h" + +L64XX_Marlin L64xxManager; + +#include "../../module/stepper/indirection.h" +#include "../../gcode/gcode.h" +#include "../../module/planner.h" +#include "../../HAL/shared/Delay.h" + +void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); } + +char L64XX_Marlin::index_to_axis[MAX_L6470][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" }; + +#define DEBUG_OUT ENABLED(L6470_CHITCHAT) +#include "../../core/debug_out.h" + +uint8_t L64XX_Marlin::dir_commands[MAX_L6470]; // array to hold direction command for each driver + +uint8_t 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) + (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 uint8_t L64XX_Marlin::spi_abort = false; +uint8_t L64XX_Marlin::spi_active = false; + +L64XX_Marlin::L64XX_shadow_t L64XX_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_IS_L64XX(X) + _L6470_INIT_SPI(X); + #endif + #if AXIS_IS_L64XX(X2) + _L6470_INIT_SPI(X2); + #endif + #if AXIS_IS_L64XX(Y) + _L6470_INIT_SPI(Y); + #endif + #if AXIS_IS_L64XX(Y2) + _L6470_INIT_SPI(Y2); + #endif + #if AXIS_IS_L64XX(Z) + _L6470_INIT_SPI(Z); + #endif + #if AXIS_IS_L64XX(Z2) + _L6470_INIT_SPI(Z2); + #endif + #if AXIS_IS_L64XX(Z3) + _L6470_INIT_SPI(Z3); + #endif + #if AXIS_IS_L64XX(E0) + _L6470_INIT_SPI(E0); + #endif + #if AXIS_IS_L64XX(E1) + _L6470_INIT_SPI(E1); + #endif + #if AXIS_IS_L64XX(E2) + _L6470_INIT_SPI(E2); + #endif + #if AXIS_IS_L64XX(E3) + _L6470_INIT_SPI(E3); + #endif + #if AXIS_IS_L64XX(E4) + _L6470_INIT_SPI(E4); + #endif + #if AXIS_IS_L64XX(E5) + _L6470_INIT_SPI(E5); + #endif +} + + +/** + * Some status bit positions & definitions differ per driver. + * Copy info to known locations to simplfy check/display logic. + * 1. Copy stepper status + * 2. Copy status bit definitions + * 3. Copy status layout + * 4. Make all error bits active low (as needed) + */ +uint16_t L64XX_Marlin::get_stepper_status(L64XX &st) { + shadow.STATUS_AXIS_RAW = st.getStatus(); + shadow.STATUS_AXIS = shadow.STATUS_AXIS_RAW; + shadow.STATUS_AXIS_LAYOUT = st.L6470_status_layout; + shadow.AXIS_OCD_TH_MAX = st.OCD_TH_MAX; + shadow.AXIS_STALL_TH_MAX = st.STALL_TH_MAX; + shadow.AXIS_OCD_CURRENT_CONSTANT_INV = st.OCD_CURRENT_CONSTANT_INV; + shadow.AXIS_STALL_CURRENT_CONSTANT_INV = st.STALL_CURRENT_CONSTANT_INV; + shadow.L6470_AXIS_CONFIG = st.L64XX_CONFIG; + shadow.L6470_AXIS_STATUS = st.L64XX_STATUS; + shadow.STATUS_AXIS_OCD = st.STATUS_OCD; + shadow.STATUS_AXIS_SCK_MOD = st.STATUS_SCK_MOD; + shadow.STATUS_AXIS_STEP_LOSS_A = st.STATUS_STEP_LOSS_A; + shadow.STATUS_AXIS_STEP_LOSS_B = st.STATUS_STEP_LOSS_B; + shadow.STATUS_AXIS_TH_SD = st.STATUS_TH_SD; + shadow.STATUS_AXIS_TH_WRN = st.STATUS_TH_WRN; + shadow.STATUS_AXIS_UVLO = st.STATUS_UVLO; + shadow.STATUS_AXIS_WRONG_CMD = st.STATUS_WRONG_CMD; + shadow.STATUS_AXIS_CMD_ERR = st.STATUS_CMD_ERR; + shadow.STATUS_AXIS_NOTPERF_CMD = st.STATUS_NOTPERF_CMD; + + switch (shadow.STATUS_AXIS_LAYOUT) { + case L6470_STATUS_LAYOUT: { // L6470 + 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 ^= (shadow.STATUS_AXIS_WRONG_CMD | shadow.STATUS_AXIS_NOTPERF_CMD); // invert just error bits that are active high + break; + } + case L6474_STATUS_LAYOUT: { // L6474 + 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 ^= (shadow.STATUS_AXIS_WRONG_CMD | shadow.STATUS_AXIS_NOTPERF_CMD); // invert just error bits that are active high + break; + } + case L6480_STATUS_LAYOUT: { // L6480 & powerSTEP01 + 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 ^= (shadow.STATUS_AXIS_CMD_ERR | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD); // invert just error bits that are active high + break; + } + } + return shadow.STATUS_AXIS; +} + + +void L64XX_Marlin::init() { // Set up SPI and then init chips + ENABLE_RESET_L64XX_CHIPS(LOW); // hardware reset of drivers + DELAY_US(100); + ENABLE_RESET_L64XX_CHIPS(HIGH); + DELAY_US(1000); // need about 650µs for the chip(s) to fully start up + 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 +} + +uint16_t L64XX_Marlin::get_status(const L64XX_axis_t axis) { + + #define STATUS_L6470(Q) get_stepper_status(stepper##Q) + + switch (axis) { + default: break; + #if AXIS_IS_L64XX(X) + case X : return STATUS_L6470(X); + #endif + #if AXIS_IS_L64XX(Y) + case Y : return STATUS_L6470(Y); + #endif + #if AXIS_IS_L64XX(Z) + case Z : return STATUS_L6470(Z); + #endif + #if AXIS_IS_L64XX(X2) + case X2: return STATUS_L6470(X2); + #endif + #if AXIS_IS_L64XX(Y2) + case Y2: return STATUS_L6470(Y2); + #endif + #if AXIS_IS_L64XX(Z2) + case Z2: return STATUS_L6470(Z2); + #endif + #if AXIS_IS_L64XX(Z3) + case Z3: return STATUS_L6470(Z3); + #endif + #if AXIS_IS_L64XX(E0) + case E0: return STATUS_L6470(E0); + #endif + #if AXIS_IS_L64XX(E1) + case E1: return STATUS_L6470(E1); + #endif + #if AXIS_IS_L64XX(E2) + case E2: return STATUS_L6470(E2); + #endif + #if AXIS_IS_L64XX(E3) + case E3: return STATUS_L6470(E3); + #endif + #if AXIS_IS_L64XX(E4) + case E4: return STATUS_L6470(E4); + #endif + #if AXIS_IS_L64XX(E5) + case E5: return STATUS_L6470(E5); + #endif + } + + return 0; // Not needed but kills a compiler warning +} + +uint32_t L64XX_Marlin::get_param(const L64XX_axis_t axis, const uint8_t param) { + + #define GET_L6470_PARAM(Q) L6470_GETPARAM(param, Q) + + switch (axis) { + default: break; + #if AXIS_IS_L64XX(X) + case X : return GET_L6470_PARAM(X); + #endif + #if AXIS_IS_L64XX(Y) + case Y : return GET_L6470_PARAM(Y); + #endif + #if AXIS_IS_L64XX(Z) + case Z : return GET_L6470_PARAM(Z); + #endif + #if AXIS_IS_L64XX(X2) + case X2: return GET_L6470_PARAM(X2); + #endif + #if AXIS_IS_L64XX(Y2) + case Y2: return GET_L6470_PARAM(Y2); + #endif + #if AXIS_IS_L64XX(Z2) + case Z2: return GET_L6470_PARAM(Z2); + #endif + #if AXIS_IS_L64XX(Z3) + case Z3: return GET_L6470_PARAM(Z3); + #endif + #if AXIS_IS_L64XX(E0) + case E0: return GET_L6470_PARAM(E0); + #endif + #if AXIS_IS_L64XX(E1) + case E1: return GET_L6470_PARAM(E1); + #endif + #if AXIS_IS_L64XX(E2) + case E2: return GET_L6470_PARAM(E2); + #endif + #if AXIS_IS_L64XX(E3) + case E3: return GET_L6470_PARAM(E3); + #endif + #if AXIS_IS_L64XX(E4) + case E4: return GET_L6470_PARAM(E4); + #endif + #if AXIS_IS_L64XX(E5) + case E5: return GET_L6470_PARAM(E5); + #endif + } + + return 0; // not needed but kills a compiler warning +} + +void L64XX_Marlin::set_param(const L64XX_axis_t axis, const uint8_t param, const uint32_t value) { + + #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value) + + switch (axis) { + default: break; + #if AXIS_IS_L64XX(X) + case X : SET_L6470_PARAM(X); break; + #endif + #if AXIS_IS_L64XX(Y) + case Y : SET_L6470_PARAM(Y); break; + #endif + #if AXIS_IS_L64XX(Z) + case Z : SET_L6470_PARAM(Z); break; + #endif + #if AXIS_IS_L64XX(X2) + case X2: SET_L6470_PARAM(X2); break; + #endif + #if AXIS_IS_L64XX(Y2) + case Y2: SET_L6470_PARAM(Y2); break; + #endif + #if AXIS_IS_L64XX(Z2) + case Z2: SET_L6470_PARAM(Z2); break; + #endif + #if AXIS_IS_L64XX(Z3) + case Z3: SET_L6470_PARAM(Z3); break; + #endif + #if AXIS_IS_L64XX(E0) + case E0: SET_L6470_PARAM(E0); break; + #endif + #if AXIS_IS_L64XX(E1) + case E1: SET_L6470_PARAM(E1); break; + #endif + #if AXIS_IS_L64XX(E2) + case E2: SET_L6470_PARAM(E2); break; + #endif + #if AXIS_IS_L64XX(E3) + case E3: SET_L6470_PARAM(E3); break; + #endif + #if AXIS_IS_L64XX(E4) + case E4: SET_L6470_PARAM(E4); break; + #endif + #if AXIS_IS_L64XX(E5) + case E5: SET_L6470_PARAM(E5); break; + #endif + } +} + +inline void echo_min_max(const char a, const float &min, const float &max) { + DEBUG_CHAR(' '); DEBUG_CHAR(a); + DEBUG_ECHOPAIR(" min = ", min); + DEBUG_ECHOLNPAIR(" max = ", max); +} +inline void echo_oct_used(const float &oct, const uint8_t stall) { + DEBUG_ECHOPAIR("over_current_threshold used : ", oct); + serialprintPGM(stall ? PSTR(" (Stall") : PSTR(" (OCD")); + DEBUG_ECHOLNPGM(" threshold)"); +} +inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("Test aborted - motion out of bounds"); } + +uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_index[3], char axis_mon[3][3], + float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, + uint8_t 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 + + uint16_t displacement = 0; // " = 0" to eliminate compiler warning + uint8_t j; // general purpose counter + + if (!all_axes_homed()) { + DEBUG_ECHOLNPGM("Test aborted - home all before running this command"); + return true; + } + + uint8_t found_displacement = false; + LOOP_XYZE(i) if (uint16_t _displacement = parser.intval(axis_codes[i])) { + found_displacement = true; + displacement = _displacement; + uint8_t axis_offset = parser.byteval('J'); + axis_mon[0][0] = axis_codes[i]; // axis ASCII value (target character) + uint8_t driver_count_local = 0; // Can't use "driver_count" directly as a subscript because it's passed by reference + if (axis_offset >= 2 || axis_mon[0][0] == 'E') { // Single axis, E0, or E1 + axis_mon[0][1] = axis_offset + '0'; + 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] = (L64XX_axis_t)j; // set axis index + driver_count_local++; + } + } + } + else if (axis_offset == 0) { // One or more axes + 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] = (L64XX_axis_t)j; // set axis index + driver_count_local++; + } + } + driver_count = driver_count_local; + } + break; // only take first axis found + } + + if (!found_displacement) { + DEBUG_ECHOLNPGM("Test aborted - AXIS with displacement is required"); + return true; + } + + // + // Position calcs & checks + // + + const float X_center = LOGICAL_X_POSITION(current_position.x), + Y_center = LOGICAL_Y_POSITION(current_position.y), + Z_center = LOGICAL_Z_POSITION(current_position.z), + E_center = current_position.e; + + switch (axis_mon[0][0]) { + default: position_max = position_min = 0; break; + + case 'X': { + position_min = X_center - displacement; + position_max = X_center + displacement; + echo_min_max('X', position_min, position_max); + if (false + #ifdef X_MIN_POS + || position_min < (X_MIN_POS) + #endif + #ifdef X_MAX_POS + || position_max > (X_MAX_POS) + #endif + ) { + err_out_of_bounds(); + return true; + } + } break; + + case 'Y': { + position_min = Y_center - displacement; + position_max = Y_center + displacement; + echo_min_max('Y', position_min, position_max); + if (false + #ifdef Y_MIN_POS + || position_min < (Y_MIN_POS) + #endif + #ifdef Y_MAX_POS + || position_max > (Y_MAX_POS) + #endif + ) { + err_out_of_bounds(); + return true; + } + } break; + + case 'Z': { + position_min = Z_center - displacement; + position_max = Z_center + displacement; + echo_min_max('Z', position_min, position_max); + if (false + #ifdef Z_MIN_POS + || position_min < (Z_MIN_POS) + #endif + #ifdef Z_MAX_POS + || position_max > (Z_MAX_POS) + #endif + ) { + err_out_of_bounds(); + return true; + } + } break; + + case 'E': { + position_min = E_center - displacement; + position_max = E_center + displacement; + echo_min_max('E', position_min, position_max); + } break; + } + + // + // Work on the drivers + // + + for (uint8_t k = 0; k < driver_count; k++) { + uint8_t not_found = true; + 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; + } + } + if (not_found) { + driver_count = k; + axis_mon[k][0] = ' '; // mark this entry invalid + break; + } + } + + if (driver_count == 0) { + DEBUG_ECHOLNPGM("Test aborted - not a L6470 axis"); + return true; + } + + DEBUG_ECHOPGM("Monitoring:"); + for (j = 0; j < driver_count; j++) DEBUG_ECHOPAIR(" ", axis_mon[j]); + DEBUG_EOL(); + + // now have a list of driver(s) to monitor + + // + // TVAL & kVAL_HOLD checks & settings + // + const L64XX_shadow_t &sh = shadow; + get_status(axis_index[0]); // populate shadow array + + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // L6474 - use TVAL + uint16_t TVAL_current = parser.ushortval('T'); + if (TVAL_current) { + uint8_t TVAL_count = (TVAL_current / sh.AXIS_STALL_CURRENT_CONSTANT_INV) - 1; + LIMIT(TVAL_count, 0, sh.AXIS_STALL_TH_MAX); + for (j = 0; j < driver_count; j++) + set_param(axis_index[j], L6474_TVAL, TVAL_count); + } + // only print the tval from one of the drivers + kval_hold = get_param(axis_index[0], L6474_TVAL); + DEBUG_ECHOLNPAIR("TVAL current (mA) = ", (kval_hold + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV); + } + else { + kval_hold = parser.byteval('K'); + if (kval_hold) { + DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold); + for (j = 0; j < driver_count; j++) + set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); + } + else { + // only print the KVAL_HOLD from one of the drivers + kval_hold = get_param(axis_index[0], L6470_KVAL_HOLD); + DEBUG_ECHOLNPAIR("KVAL_HOLD = ", kval_hold); + } + } + + // + // Overcurrent checks & settings + // + + if (over_current_flag) { + + uint8_t OCD_TH_val_local = 0, // compiler thinks OCD_TH_val is unused if use it directly + STALL_TH_val_local = 0; // just in case ... + + over_current_threshold = parser.intval('I'); + + if (over_current_threshold) { + + OCD_TH_val_local = over_current_threshold/375; + LIMIT(OCD_TH_val_local, 0, 15); + STALL_TH_val_local = over_current_threshold/31.25; + LIMIT(STALL_TH_val_local, 0, 127); + uint16_t OCD_TH_actual = (OCD_TH_val_local + 1) * 375, + STALL_TH_actual = (STALL_TH_val_local + 1) * 31.25; + if (OCD_TH_actual < STALL_TH_actual) { + OCD_TH_val_local++; + OCD_TH_actual = (OCD_TH_val_local + 1) * 375; + } + + DEBUG_ECHOLNPAIR("over_current_threshold specified: ", over_current_threshold); + if (!(sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)) echo_oct_used((STALL_TH_val_local + 1) * 31.25, true); + echo_oct_used((OCD_TH_val_local + 1) * 375, false); + + #define SET_OVER_CURRENT(Q) do { stepper##Q.SetParam(L6470_STALL_TH, STALL_TH_val_local); stepper##Q.SetParam(L6470_OCD_TH, OCD_TH_val_local);} while (0) + + for (j = 0; j < driver_count; j++) { + set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local); + set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local); + } + } + else { + // only get & print the OVER_CURRENT values from one of the drivers + STALL_TH_val_local = get_param(axis_index[0], L6470_STALL_TH); + OCD_TH_val_local = get_param(axis_index[0], L6470_OCD_TH); + + if (!(sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)) echo_oct_used((STALL_TH_val_local + 1) * 31.25, true); + echo_oct_used((OCD_TH_val_local + 1) * 375, false); + } // over_current_threshold + + for (j = 0; j < driver_count; j++) { // set all drivers on axis the same + set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local); + set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local); + } + + OCD_TH_val = OCD_TH_val_local; // force compiler to update the main routine's copy + STALL_TH_val = STALL_TH_val_local; // force compiler to update the main routine's copy + } // end of overcurrent + + // + // Feedrate + // + + final_feedrate = parser.floatval('F'); + if (final_feedrate == 0) { + static constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE; + const uint8_t num_feedrates = COUNT(default_max_feedrate); + for (j = 0; j < num_feedrates; j++) { + if (axis_codes[j] == axis_mon[0][0]) { + final_feedrate = default_max_feedrate[j]; + break; + } + } + if (j == 3 && num_feedrates > 4) { // have more than one extruder feedrate + uint8_t extruder_num = axis_mon[0][1] - '0'; + if (j <= num_feedrates - extruder_num) // have a feedrate specifically for this extruder + final_feedrate = default_max_feedrate[j + extruder_num]; + else + final_feedrate = default_max_feedrate[3]; // use E0 feedrate for this extruder + } + final_feedrate *= 60; // convert to mm/minute + } // end of feedrate + + return false; // FALSE indicates no user input problems +} + +void L64XX_Marlin::say_axis(const L64XX_axis_t axis, const uint8_t label/*=true*/) { + if (label) SERIAL_ECHOPGM("AXIS:"); + const char * const str = L64xxManager.index_to_axis[axis]; + SERIAL_CHAR(' ', str[0], str[1], ' '); +} + +#if ENABLED(L6470_CHITCHAT) + + // Assumes status bits have been inverted + void L64XX_Marlin::error_status_decode(const uint16_t status, const L64XX_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, const uint8_t _status_axis_layout + ) { + say_axis(axis); + DEBUG_ECHOPGM(" THERMAL: "); + 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_axis_ocd) != 0); + if (!(_status_axis_layout == L6474_STATUS_LAYOUT)) { // L6474 doesn't have these bits + DEBUG_ECHOPGM(" STALL: "); + echo_yes_no((status & (_status_axis_step_loss_a | _status_axis_step_loss_b)) != 0); + } + DEBUG_EOL(); + } + +#endif + +////////////////////////////////////////////////////////////////////////////////////////////////// +//// +//// MONITOR_L6470_DRIVER_STATUS routines +//// +////////////////////////////////////////////////////////////////////////////////////////////////// + +#if ENABLED(MONITOR_L6470_DRIVER_STATUS) + + bool L64XX_Marlin::monitor_paused = false; // Flag to skip monitor during M122, M906, M916, M917, M918, etc. + + struct L6470_driver_data { + uint8_t driver_index; + uint32_t driver_status; + uint8_t is_otw; + uint8_t otw_counter; + uint8_t is_ot; + uint8_t is_hi_Z; + uint8_t com_counter; + }; + + L6470_driver_data driver_L6470_data[] = { + #if AXIS_IS_L64XX(X) + { 0, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(Y) + { 1, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(Z) + { 2, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(X2) + { 3, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(Y2) + { 4, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(Z2) + { 5, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(Z3) + { 6, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(E0) + { 7, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(E1) + { 8, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(E2) + { 9, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(E3) + { 10, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(E4) + { 11, 0, 0, 0, 0, 0, 0 }, + #endif + #if AXIS_IS_L64XX(E5) + { 12, 0, 0, 0, 0, 0, 0 } + #endif + }; + + void L64XX_Marlin::append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err/*=nullptr*/) { + p += sprintf_P(p, PSTR("Stepper %c%c "), index_to_axis[stepper_index][0], index_to_axis[stepper_index][1]); + if (err) p += sprintf_P(p, err); + } + + void L64XX_Marlin::monitor_update(L64XX_axis_t stepper_index) { + if (spi_abort) return; // don't do anything if set_directions() has occurred + const L64XX_shadow_t &sh = shadow; + get_status(stepper_index); // get stepper status and details + uint16_t status = sh.STATUS_AXIS; + uint8_t kval_hold, tval; + char temp_buf[120], *p = temp_buf; + uint8_t j; + 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; + uint16_t _status = ~status; // all error bits are active low + + if (status == 0 || status == 0xFFFF) { // com problem + if (driver_L6470_data[j].com_counter == 0) { // warn user when it first happens + driver_L6470_data[j].com_counter++; + append_stepper_err(p, stepper_index, PSTR(" - communications lost\n")); + DEBUG_ECHO(temp_buf); + } + else { + driver_L6470_data[j].com_counter++; + if (driver_L6470_data[j].com_counter > 240) { // remind of com problem about every 2 minutes + driver_L6470_data[j].com_counter = 1; + append_stepper_err(p, stepper_index, PSTR(" - still no communications\n")); + DEBUG_ECHO(temp_buf); + } + } + } + else { + if (driver_L6470_data[j].com_counter) { // comms re-established + driver_L6470_data[j].com_counter = 0; + append_stepper_err(p, stepper_index, PSTR(" - communications re-established\n.. setting all drivers to default values\n")); + DEBUG_ECHO(temp_buf); + init_to_defaults(); + } + else { + // no com problems - do the usual checks + if (_status & sh.L6470_ERROR_MASK) { + append_stepper_err(p, stepper_index); + + 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 & sh.STATUS_AXIS_TH_SD) { // strange - TH_SD never seems to go active, must be implied by the HiZ and TH_WRN + if (_status & sh.STATUS_AXIS_TH_WRN) { // over current shutdown + p += sprintf_P(p, PSTR("%cdue to over temperature"), ' '); + driver_L6470_data[j].is_ot = true; + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // L6474 + tval = get_param(stepper_index, L6474_TVAL) - 2 * KVAL_HOLD_STEP_DOWN; + set_param(stepper_index, L6474_TVAL, tval); // reduce TVAL + p += sprintf_P(p, PSTR(" - TVAL reduced by %d to %d mA"), uint16_t (2 * KVAL_HOLD_STEP_DOWN * sh.AXIS_STALL_CURRENT_CONSTANT_INV), uint16_t ((tval + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV)); // let user know + } + else { + kval_hold = get_param(stepper_index, L6470_KVAL_HOLD) - 2 * KVAL_HOLD_STEP_DOWN; + set_param(stepper_index, L6470_KVAL_HOLD, kval_hold); // reduce KVAL_HOLD + p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), 2 * KVAL_HOLD_STEP_DOWN, kval_hold); // let user know + } + } + else + driver_L6470_data[j].is_ot = false; + } + else { + driver_L6470_data[j].is_hi_Z = false; + + if (_status & sh.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); + if (driver_L6470_data[j].otw_counter > 4) { // otw present for 2 - 2.5 seconds, reduce KVAL_HOLD + driver_L6470_data[j].otw_counter = 0; + driver_L6470_data[j].is_otw = true; + if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // L6474 + tval = get_param(stepper_index, L6474_TVAL) - KVAL_HOLD_STEP_DOWN; + set_param(stepper_index, L6474_TVAL, tval); // reduce TVAL + p += sprintf_P(p, PSTR(" - TVAL reduced by %d to %d mA"), uint16_t (KVAL_HOLD_STEP_DOWN * sh.AXIS_STALL_CURRENT_CONSTANT_INV), uint16_t ((tval + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV)); // let user know + } + else { + kval_hold = get_param(stepper_index, L6470_KVAL_HOLD) - KVAL_HOLD_STEP_DOWN; + set_param(stepper_index, L6470_KVAL_HOLD, kval_hold); // reduce KVAL_HOLD + p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), KVAL_HOLD_STEP_DOWN, kval_hold); // let user know + } + } + else if (driver_L6470_data[j].otw_counter) + p += sprintf_P(p, PSTR("%c- thermal warning"), ' '); // warn user + } + } + + #if ENABLED(L6470_STOP_ON_ERROR) + if (_status & (sh.STATUS_AXIS_UVLO | sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) + kill(temp_buf); + #endif + + #if ENABLED(L6470_CHITCHAT) + if (_status & sh.STATUS_AXIS_OCD) + p += sprintf_P(p, PSTR("%c over current"), ' '); + + if (_status & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B)) + p += sprintf_P(p, PSTR("%c stall"), ' '); + + if (_status & sh.STATUS_AXIS_UVLO) + p += sprintf_P(p, PSTR("%c under voltage lock out"), ' '); + + p += sprintf_P(p, PSTR("%c\n"), ' '); + #endif + + DEBUG_ECHOLN(temp_buf); // print the error message + } + else { + 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 monitor_update() + + + void L64XX_Marlin::monitor_driver() { + static millis_t next_cOT = 0; + if (ELAPSED(millis(), next_cOT)) { + next_cOT = millis() + 500; + + if (!monitor_paused) { // Skip during M122, M906, M916, M917 or M918 (could steal status result from test) + + spi_active = true; // Tell set_directions() a series of SPI transfers is underway + + #if AXIS_IS_L64XX(X) + monitor_update(X); + #endif + #if AXIS_IS_L64XX(Y) + monitor_update(Y); + #endif + #if AXIS_IS_L64XX(Z) + monitor_update(Z); + #endif + #if AXIS_IS_L64XX(X2) + monitor_update(X2); + #endif + #if AXIS_IS_L64XX(Y2) + monitor_update(Y2); + #endif + #if AXIS_IS_L64XX(Z2) + monitor_update(Z2); + #endif + #if AXIS_IS_L64XX(Z3) + monitor_update(Z3); + #endif + #if AXIS_IS_L64XX(E0) + monitor_update(E0); + #endif + #if AXIS_IS_L64XX(E1) + monitor_update(E1); + #endif + #if AXIS_IS_L64XX(E2) + monitor_update(E2); + #endif + #if AXIS_IS_L64XX(E3) + monitor_update(E3); + #endif + #if AXIS_IS_L64XX(E4) + monitor_update(E4); + #endif + #if AXIS_IS_L64XX(E5) + monitor_update(E5); + #endif + + #if ENABLED(L6470_DEBUG) + if (report_L6470_status) DEBUG_EOL(); + #endif + + spi_active = false; // done with all SPI transfers - clear handshake flags + spi_abort = false; + } + } + } + +#endif // MONITOR_L6470_DRIVER_STATUS + +#endif // HAS_L64XX diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.h b/Marlin/src/libs/L64XX/L64XX_Marlin.h new file mode 100644 index 0000000000..a0b5e5e5ae --- /dev/null +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.h @@ -0,0 +1,141 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "../../inc/MarlinConfig.h" + +#include +#if !(L6470_LIBRARY_VERSION >= 0x000800) + #error 'L6470_LIBRARY_VERSION 0x000800 or later required' +#endif + +#define L6470_GETPARAM(P,Q) stepper##Q.GetParam(P) + +#define MAX_L6470 (7 + MAX_EXTRUDERS) // Maximum number of axes in Marlin + +#define dSPIN_STEP_CLOCK 0x58 +#define dSPIN_STEP_CLOCK_FWD dSPIN_STEP_CLOCK +#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)) + +typedef enum : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 } L64XX_axis_t; + +class L64XX_Marlin : public L64XXHelper { +public: + static char index_to_axis[MAX_L6470][3]; + + static uint8_t index_to_dir[MAX_L6470]; + static uint8_t dir_commands[MAX_L6470]; + + // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer + static volatile uint8_t spi_abort; + static uint8_t spi_active; + + L64XX_Marlin() {} + + static void init(); + static void init_to_defaults(); + + static uint16_t get_stepper_status(L64XX &st); + + static uint16_t get_status(const L64XX_axis_t axis); + + static uint32_t get_param(const L64XX_axis_t axis, const uint8_t param); + + static void set_param(const L64XX_axis_t axis, const uint8_t param, const uint32_t value); + + //static void send_command(const L64XX_axis_t axis, uint8_t command); + + static uint8_t get_user_input(uint8_t &driver_count, L64XX_axis_t axis_index[3], char axis_mon[3][3], + float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, + uint8_t over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold); + + 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 L64XX_axis_t axis, const uint8_t label=true); + #if ENABLED(L6470_CHITCHAT) + static void error_status_decode( + const uint16_t status, const L64XX_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, const uint8_t _status_axis_layout + ); + #else + FORCE_INLINE static void error_status_decode( + const uint16_t, const L64XX_axis_t, + const uint16_t, const uint16_t, + const uint16_t, const uint16_t, + const uint16_t, const uint8_t + ){} + #endif + + // ~40 bytes SRAM to simplify status decode routines + typedef struct { + uint8_t 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 + L6474_ERROR_MASK, // STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD | STATUS_OCD + 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; + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + static bool monitor_paused; + static inline void pause_monitor(const bool p) { monitor_paused = p; } + static void monitor_update(L64XX_axis_t stepper_index); + static void monitor_driver(); + #else + static inline void pause_monitor(const bool) {} + #endif + +//protected: + // L64XXHelper methods + static void spi_init(); + static uint8_t transfer_single(uint8_t data, int16_t ss_pin); + static uint8_t transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain_position); + +private: + static void append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err=nullptr); + +}; + +void echo_yes_no(const bool yes); + +extern L64XX_Marlin L64xxManager; diff --git a/Marlin/src/libs/L64XX/README.md b/Marlin/src/libs/L64XX/README.md new file mode 100644 index 0000000000..c68d8ca0ed --- /dev/null +++ b/Marlin/src/libs/L64XX/README.md @@ -0,0 +1,98 @@ +### L64XX Stepper Driver + +*Arduino-L6470* library revision 0.8.0 or above is required. + +This software can be used with the L6470, L6474, L6480 and the powerSTEP01 (collectively referred to as "L64xx" from now on). Different drivers can be mixed within a system. + +These devices use voltage PWMs to drive the stepper phases. On the L6474 the phase current is controlled by the `TVAL` register. On all the other drivers the phase current is indirectly controlled via the `KVAL_HOLD` register which scales the PWM duty cycle. + +This software assumes that all drivers are in one SPI daisy chain. + +### Hardware Setup + +- MOSI from controller tied to SDI on the first device + +- SDO of the first device is tied to SDI of the next device + +- SDO of the last device is tied to MISO of the controller + +- All devices share the same `SCK` and `SS_PIN` pins. The user must supply a macro to control the `RESET_PIN`(s). + +- Each L6470 passes the data it saw on its SDI to its neighbor on the **NEXT** SPI cycle (8 bit delay). + +- Each L6470 acts on the **last** SPI data it saw when the `SS_PIN` **goes high**. + +The L6474 uses the standard STEP DIR interface. Phase currents are changed in response to step pulses. The direction is set by the DIR pin. Instead of an ENA pin, stepper power is controlled with SPI commands. + +The other drivers operate in `STEP_CLOCK` mode. In this mode the Direction / Enable functions are done with SPI commands and the phase currents are changed in response to STEP pulses. + +### Hardware / Software Interaction + +Except for the L6474, powering up a stepper and setting the direction are done by the same command. You can't do one without the other. + +**All** directions are set **every time** a new block is popped off the queue by the stepper ISR. + +When setting direction, SPI transfers are minimized by using arrays and a specialized SPI method. *Arduino-L6470* library calls are not used. For N L64xx drivers, this results in N bytes transferred. If library calls were used then N2 bytes would be sent. + +### Power-up (Reset) Sequence + +- Stepper objects are instantiated before the `setup()` entry point is reached. + +- In `setup()` (before stepper drivers are initialized) the `L6470_init()` method is called to do the following: + + - If present, pulse the hardware reset pin. + + - Populate the `L6470_chain` array, which maps positions in the SPI stream to commands/data for L64XX stepper drivers. + + - Initialize the L64XX Software SPI pin states. + + - Initialize L64XX drivers. They may be reset later by a call to `L6470_init_to_defaults()`. + +The steppers are **NOT** powered up (enabled) during this sequence. + +### `L6470_chain` array + +This array is used by all routines that transmit SPI data. For a chain with N devices, the array contains: + +Index|Value +-----|----- +0|Number of drivers in chain +1|Axis index of the first device in the chain (closest to MOSI) +...| +N|Axis index of the last device chain (closest to MISO) + +### Set Direction and Enable + +The `DIR_WRITE` macros for the L64xx drivers are written so that the standard X, Y, Z and extruder logic used by the `set_directions()` routine is not altered. These macros write the correct forward/reverse command to the corresponding location in the array `L6470_dir_commands`. On the L6474 the array the command used just enables the stepper because direction is set by the DIR pin. + +At the end of the `set_directions()` routine, the array `L6470_chain` is used to grab the corresponding direction/enable commands out of the array `L6470_dir_commands` and put them in the correct sequence in the array `L6470_buf`. Array `L6470_buf` is then passed to the **`void`** `L6470_Transfer` function which actually sends the data to the devices. + +### Utilities, etc. + +The **absolute position** registers should accurately reflect Marlin’s stepper position counts. They are set to zero during initialization. `G28` sets them to the Marlin counts for the corresponding axis after homing. NOTE: These registers are often the negative of the Marlin counts. This is because the Marlin counts reflect the logical direction while the registers reflect the stepper direction. The register contents are displayed via the `M114 D` command. + +The `L6470_monitor` feature reads the status of each device every half second. It will report if there are any error conditions present or if communications has been lost/restored. The `KVAL_HOLD` value is reduced every 2 – 2.5 seconds if the thermal warning or thermal shutdown conditions are present. + +**M122** displays the settings of most of the bits in the status register plus a couple of other items. + +**M906** can be used to set the `KVAL_HOLD` register (`TVAL` on L6474) one driver at a time. If a setting is not included with the command then the contents of the registers that affect the phase current/voltage are displayed. + +**M916, M917 & M918** + +These utilities are used to tune the system. They can get you in the ballpark for acceptable jerk, acceleration, top speed and `KVAL_HOLD` settings (`TVAL` on L6474). In general they seem to provide an overly optimistic `KVAL_HOLD` (`TVAL`) setting because of the lag between setting `KVAL_HOLD` (`TVAL`) and the driver reaching final temperature. Enabling the `L6470_monitor` feature during prints will provide the **final useful setting**. + +The amount of power needed to move the stepper without skipping steps increases as jerk, acceleration, top speed, and micro-steps increase. The power dissipated by the driver increases as the power to the stepper increases. The net result is a balancing act between jerk, acceleration, top speed, micro-steps, and power dissipated by the driver. + +**M916** - Increases `KVAL_HOLD` (`TVAL`) while moving one axis until a thermal warning is generated. This routine is also useful for determining the approximate `KVAL_HOLD` (`TVAL`) where the stepper stops losing steps. The sound will get noticeably quieter as it stops losing steps. + +**M917** - Find minimum current thresholds. This is accomplished by doing the following steps while moving an axis: + +1. Decrease OCD current until overcurrent error. + +2. Increase OCD until overcurrent error goes away. + +3. Decrease stall threshold until stall error (not available on the L6474). + +4. Increase stall until stall error goes away (not available on the L6474). + +**M918** - Increase speed until error or max feedrate achieved. diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 1ba473946a..4aa2208b68 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -117,8 +117,10 @@ Stepper stepper; // Singleton #include "../feature/runout.h" #endif -#if HAS_DRIVER(L6470) - #include "../libs/L6470/L6470_Marlin.h" +#if HAS_L64XX + #include "../libs/L64XX/L64XX_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 ENABLED(POWER_LOSS_RECOVERY) @@ -371,21 +373,17 @@ 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 - #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0 DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); #endif #define SET_STEP_DIR(A) \ if (motor_direction(_AXIS(A))) { \ - A##_APPLY_DIR(INVERT_## A##_DIR, false); \ + A##_APPLY_DIR(INVERT_##A##_DIR, false); \ count_direction[_AXIS(A)] = -1; \ } \ else { \ - A##_APPLY_DIR(!INVERT_## A##_DIR, false); \ + A##_APPLY_DIR(!INVERT_##A##_DIR, false); \ count_direction[_AXIS(A)] = 1; \ } @@ -425,25 +423,25 @@ void Stepper::set_directions() { #endif #endif // !LIN_ADVANCE - #if HAS_DRIVER(L6470) + #if HAS_L64XX + if (L64XX_OK_to_power_up) { // OK to send the direction commands (which powers up the L64XX steppers) + if (L64xxManager.spi_active) { + L64xxManager.spi_abort = true; // Interrupted SPI transfer needs to shut down gracefully + for (uint8_t j = 1; j <= L64XX::chain[0]; j++) + L6470_buf[j] = dSPIN_NOP; // Fill buffer with NOOPs + L64xxManager.transfer(L6470_buf, L64XX::chain[0]); // Send enough NOOPs to complete any command + L64xxManager.transfer(L6470_buf, L64XX::chain[0]); + L64xxManager.transfer(L6470_buf, L64XX::chain[0]); + } - 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]); + // L64xxManager.dir_commands[] is an array that holds direction command for each stepper + + // Scan command array, copy matches into L64xxManager.transfer + for (uint8_t j = 1; j <= L64XX::chain[0]; j++) + L6470_buf[j] = L64xxManager.dir_commands[L64XX::chain[j]]; + + L64xxManager.transfer(L6470_buf, L64XX::chain[0]); // send the command stream to the drivers } - - // The L6470.dir_commands[] array holds the direction command for each stepper - - //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]]; - - L6470.transfer(L6470_buf, L6470::chain[0]); // send the command stream to the drivers - #endif // A small delay may be needed after changing direction @@ -1846,8 +1844,8 @@ uint32_t Stepper::stepper_block_phase_isr() { #endif if ( - #if HAS_DRIVER(L6470) - true // Always set direction for L6470 (This also enables the chips) + #if HAS_L64XX + true // Always set direction for L64xx (This also enables the chips) #else current_block->direction_bits != last_direction_bits #if DISABLED(MIXING_EXTRUDER) @@ -1859,6 +1857,10 @@ uint32_t Stepper::stepper_block_phase_isr() { #if EXTRUDERS > 1 last_moved_extruder = stepper_extruder; #endif + + #if HAS_L64XX + L64XX_OK_to_power_up = true; + #endif set_directions(); } diff --git a/Marlin/src/module/stepper/L6470.cpp b/Marlin/src/module/stepper/L6470.cpp deleted file mode 100644 index d682193aa9..0000000000 --- a/Marlin/src/module/stepper/L6470.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper/L6470.cpp - * Stepper driver indirection for L6470 drivers - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_DRIVER(L6470) - -#include "L6470.h" - -#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); -#endif -#if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_DEFINE(X2); -#endif -#if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_DEFINE(Y); -#endif -#if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_DEFINE(Y2); -#endif -#if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_DEFINE(Z); -#endif -#if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_DEFINE(Z2); -#endif -#if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_DEFINE(Z3); -#endif -#if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_DEFINE(E0); -#endif -#if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_DEFINE(E1); -#endif -#if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_DEFINE(E2); -#endif -#if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_DEFINE(E3); -#endif -#if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_DEFINE(E4); -#endif -#if AXIS_DRIVER_TYPE_E5(L6470) - _L6470_DEFINE(E5); -#endif - -// not using L6470 library's init command 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) - -void L6470_Marlin::init_to_defaults() { - #if AXIS_DRIVER_TYPE_X(L6470) - _L6470_INIT_CHIP(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_INIT_CHIP(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_INIT_CHIP(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_INIT_CHIP(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_INIT_CHIP(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_INIT_CHIP(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_INIT_CHIP(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_INIT_CHIP(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_INIT_CHIP(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_INIT_CHIP(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_INIT_CHIP(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_INIT_CHIP(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - _L6470_INIT_CHIP(E5); - #endif -} - -#endif // L6470 diff --git a/Marlin/src/module/stepper/L6470.h b/Marlin/src/module/stepper/L6470.h deleted file mode 100644 index 8c731a8042..0000000000 --- a/Marlin/src/module/stepper/L6470.h +++ /dev/null @@ -1,176 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * stepper/L6470.h - * Stepper driver indirection for L6470 drivers - */ - -#include "../../inc/MarlinConfig.h" -#include "../../libs/L6470/L6470_Marlin.h" - -// L6470 has STEP on normal pins, but DIR/ENABLE via SPI -#define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L6470_dir_commands[Q] = (STATE ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0) - -// X Stepper -#if AXIS_DRIVER_TYPE_X(L6470) - extern L6470 stepperX; - #define X_ENABLE_INIT NOOP - #define X_ENABLE_WRITE(STATE) NOOP - #define X_ENABLE_READ() (stepperX.getStatus() & STATUS_HIZ) - #define X_DIR_INIT NOOP - #define X_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X) - #define X_DIR_READ() (stepperX.getStatus() & STATUS_DIR) -#endif - -// Y Stepper -#if AXIS_DRIVER_TYPE_Y(L6470) - extern L6470 stepperY; - #define Y_ENABLE_INIT NOOP - #define Y_ENABLE_WRITE(STATE) NOOP - #define Y_ENABLE_READ() (stepperY.getStatus() & STATUS_HIZ) - #define Y_DIR_INIT NOOP - #define Y_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y) - #define Y_DIR_READ() (stepperY.getStatus() & STATUS_DIR) -#endif - -// Z Stepper -#if AXIS_DRIVER_TYPE_Z(L6470) - extern L6470 stepperZ; - #define Z_ENABLE_INIT NOOP - #define Z_ENABLE_WRITE(STATE) NOOP - #define Z_ENABLE_READ() (stepperZ.getStatus() & STATUS_HIZ) - #define Z_DIR_INIT NOOP - #define Z_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z) - #define Z_DIR_READ() (stepperZ.getStatus() & STATUS_DIR) -#endif - -// X2 Stepper -#if HAS_X2_ENABLE && AXIS_DRIVER_TYPE_X2(L6470) - extern L6470 stepperX2; - #define X2_ENABLE_INIT NOOP - #define X2_ENABLE_WRITE(STATE) NOOP - #define X2_ENABLE_READ() (stepperX2.getStatus() & STATUS_HIZ) - #define X2_DIR_INIT NOOP - #define X2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X2) - #define X2_DIR_READ() (stepperX2.getStatus() & STATUS_DIR) -#endif - -// Y2 Stepper -#if HAS_Y2_ENABLE && AXIS_DRIVER_TYPE_Y2(L6470) - extern L6470 stepperY2; - #define Y2_ENABLE_INIT NOOP - #define Y2_ENABLE_WRITE(STATE) NOOP - #define Y2_ENABLE_READ() (stepperY2.getStatus() & STATUS_HIZ) - #define Y2_DIR_INIT NOOP - #define Y2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y2) - #define Y2_DIR_READ() (stepperY2.getStatus() & STATUS_DIR) -#endif - -// Z2 Stepper -#if HAS_Z2_ENABLE && AXIS_DRIVER_TYPE_Z2(L6470) - extern L6470 stepperZ2; - #define Z2_ENABLE_INIT NOOP - #define Z2_ENABLE_WRITE(STATE) NOOP - #define Z2_ENABLE_READ() (stepperZ2.getStatus() & STATUS_HIZ) - #define Z2_DIR_INIT NOOP - #define Z2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z2) - #define Z2_DIR_READ() (stepperZ2.getStatus() & STATUS_DIR) -#endif - -// Z3 Stepper -#if HAS_Z3_ENABLE && AXIS_DRIVER_TYPE_Z3(L6470) - extern L6470 stepperZ3; - #define Z3_ENABLE_INIT NOOP - #define Z3_ENABLE_WRITE(STATE) NOOP - #define Z3_ENABLE_READ() (stepperZ3.getStatus() & STATUS_HIZ) - #define Z3_DIR_INIT NOOP - #define Z3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z3) - #define Z3_DIR_READ() (stepperZ3.getStatus() & STATUS_DIR) -#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) -#endif - -// 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) -#endif - -// 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) -#endif - -// 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) -#endif - -// 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) -#endif - -// 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) -#endif diff --git a/Marlin/src/module/stepper/L64xx.cpp b/Marlin/src/module/stepper/L64xx.cpp new file mode 100644 index 0000000000..c007d418ab --- /dev/null +++ b/Marlin/src/module/stepper/L64xx.cpp @@ -0,0 +1,210 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * stepper/L64xx.cpp + * Stepper driver indirection for L64XX drivers + */ + +#include "../../inc/MarlinConfig.h" + +#if HAS_L64XX + +#include "L64xx.h" + +#if AXIS_IS_L64XX(X) + L64XX_CLASS(X) stepperX(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(X2) + L64XX_CLASS(X2) stepperX2(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(Y) + L64XX_CLASS(Y) stepperY(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(Y2) + L64XX_CLASS(Y2) stepperY2(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(Z) + L64XX_CLASS(Z) stepperZ(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(Z2) + L64XX_CLASS(Z2) stepperZ2(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(Z3) + L64XX_CLASS(Z3) stepperZ3(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(E0) + L64XX_CLASS(E0) stepperE0(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(E1) + L64XX_CLASS(E1) stepperE1(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(E2) + L64XX_CLASS(E2) stepperE2(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(E3) + L64XX_CLASS(E3) stepperE3(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(E4) + L64XX_CLASS(E4) stepperE4(L6470_CHAIN_SS_PIN); +#endif +#if AXIS_IS_L64XX(E5) + L64XX_CLASS(E5) stepperE5(L6470_CHAIN_SS_PIN); +#endif + +// Not using L64XX class init method because it +// 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(L64xxManager.spi_init, L64xxManager.transfer_single, L64xxManager.transfer_chain); // specify which external SPI routines to use + switch (st.L6470_status_layout) { + case L6470_STATUS_LAYOUT: { + 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); + uint32_t config_temp = st.GetParam(st.L64XX_CONFIG); + config_temp &= ~CONFIG_POW_SR; + switch (slew_rate) { + case 0: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_75V_us); break; + default: + case 1: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_110V_us); break; + case 3: + case 2: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_260V_us); break; + } + st.getStatus(); + st.getStatus(); + break; + } + + case L6474_STATUS_LAYOUT: { + st.free(); + //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(L6474_TVAL, 0xFF); + st.setMicroSteps(ms); + st.setOverCurrent(oc); + st.setTVALCurrent(sc); + st.SetParam(L6470_ABS_POS, 0); + uint32_t config_temp = st.GetParam(st.L64XX_CONFIG); + config_temp &= ~CONFIG_POW_SR & ~CONFIG_EN_TQREG; // clear out slew rate and set current to be controlled by TVAL register + 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; + //case 0: st.SetParam(st.L64XX_CONFIG, 0x2E88 | CONFIG_EN_TQREG | CONFIG_SR_75V_us); break; + //default: + //case 1: st.SetParam(st.L64XX_CONFIG, 0x2E88 | CONFIG_EN_TQREG | CONFIG_SR_110V_us); break; + //case 3: + //case 2: st.SetParam(st.L64XX_CONFIG, 0x2E88 | CONFIG_EN_TQREG | CONFIG_SR_260V_us); break; + + //case 0: st.SetParam(st.L64XX_CONFIG, 0x2E88 ); break; + //default: + //case 1: st.SetParam(st.L64XX_CONFIG, 0x2E88 ); break; + //case 3: + //case 2: st.SetParam(st.L64XX_CONFIG, 0x2E88 ); break; + } + st.getStatus(); + st.getStatus(); + break; + } + + case L6480_STATUS_LAYOUT: { + 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); + st.SetParam(st.L64XX_CONFIG,(st.GetParam(st.L64XX_CONFIG) | PWR_VCC_7_5V)); + st.getStatus(); // must clear out status bits before can set slew rate + st.getStatus(); + switch (slew_rate) { + case 0: st.SetParam(L6470_GATECFG1, CONFIG1_SR_220V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_220V_us); break; + default: + case 1: st.SetParam(L6470_GATECFG1, CONFIG1_SR_400V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_400V_us); break; + case 2: st.SetParam(L6470_GATECFG1, CONFIG1_SR_520V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_520V_us); break; + case 3: st.SetParam(L6470_GATECFG1, CONFIG1_SR_980V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_980V_us); break; + } + break; + } + } +} + +#define L6470_INIT_CHIP(Q) L6470_init_chip(stepper##Q, Q##_MICROSTEPS, Q##_OVERCURRENT, Q##_STALLCURRENT, Q##_MAX_VOLTAGE, Q##_SLEW_RATE) + +void L64XX_Marlin::init_to_defaults() { + #if AXIS_IS_L64XX(X) + L6470_INIT_CHIP(X); + #endif + #if AXIS_IS_L64XX(X2) + L6470_INIT_CHIP(X2); + #endif + #if AXIS_IS_L64XX(Y) + L6470_INIT_CHIP(Y); + #endif + #if AXIS_IS_L64XX(Y2) + L6470_INIT_CHIP(Y2); + #endif + #if AXIS_IS_L64XX(Z) + L6470_INIT_CHIP(Z); + #endif + #if AXIS_IS_L64XX(Z2) + L6470_INIT_CHIP(Z2); + #endif + #if AXIS_IS_L64XX(Z3) + L6470_INIT_CHIP(Z3); + #endif + #if AXIS_IS_L64XX(E0) + L6470_INIT_CHIP(E0); + #endif + #if AXIS_IS_L64XX(E1) + L6470_INIT_CHIP(E1); + #endif + #if AXIS_IS_L64XX(E2) + L6470_INIT_CHIP(E2); + #endif + #if AXIS_IS_L64XX(E3) + L6470_INIT_CHIP(E3); + #endif + #if AXIS_IS_L64XX(E4) + L6470_INIT_CHIP(E4); + #endif + #if AXIS_IS_L64XX(E5) + L6470_INIT_CHIP(E5); + #endif +} + +#endif // HAS_L64XX diff --git a/Marlin/src/module/stepper/L64xx.h b/Marlin/src/module/stepper/L64xx.h new file mode 100644 index 0000000000..36ce5610f2 --- /dev/null +++ b/Marlin/src/module/stepper/L64xx.h @@ -0,0 +1,263 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * stepper/L64xx.h + * Stepper driver indirection for L64XX drivers + */ + +#include "../../inc/MarlinConfig.h" +#include "../../libs/L64XX/L64XX_Marlin.h" + +// Convert option names to L64XX classes +#define CLASS_L6470 L6470 +#define CLASS_L6474 L6474 +#define CLASS_POWERSTEP01 powerSTEP01 + +#define __L64XX_CLASS(TYPE) CLASS_##TYPE +#define _L64XX_CLASS(TYPE) __L64XX_CLASS(TYPE) +#define L64XX_CLASS(ST) _L64XX_CLASS(ST##_DRIVER_TYPE) + +#define L6474_DIR_WRITE(A,STATE) do{ L64xxManager.dir_commands[A] = dSPIN_L6474_ENABLE; WRITE(A##_DIR_PIN, STATE); }while(0) +#define L64XX_DIR_WRITE(A,STATE) do{ L64xxManager.dir_commands[A] = (STATE) ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD; }while(0) + +// X Stepper +#if AXIS_IS_L64XX(X) + extern L64XX_CLASS(X) stepperX; + #define X_ENABLE_INIT NOOP + #define X_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperX.free()) + #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_X(L6474) + #define X_DIR_INIT SET_OUTPUT(X_DIR_PIN) + #define X_DIR_WRITE(STATE) L6474_DIR_WRITE(X, STATE) + #define X_DIR_READ READ(X_DIR_PIN) + #else + #define X_DIR_INIT NOOP + #define X_DIR_WRITE(STATE) L64XX_DIR_WRITE(X, STATE) + #define X_DIR_READ (stepper##X.getStatus() & STATUS_DIR); + #endif +#endif + +// Y Stepper +#if AXIS_IS_L64XX(Y) + extern L64XX_CLASS(Y) stepperY; + #define Y_ENABLE_INIT NOOP + #define Y_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperY.free()) + #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_Y(L6474) + #define Y_DIR_INIT SET_OUTPUT(Y_DIR_PIN) + #define Y_DIR_WRITE(STATE) L6474_DIR_WRITE(Y, STATE) + #define Y_DIR_READ READ(Y_DIR_PIN) + #else + #define Y_DIR_INIT NOOP + #define Y_DIR_WRITE(STATE) L64XX_DIR_WRITE(Y, STATE) + #define Y_DIR_READ (stepper##Y.getStatus() & STATUS_DIR); + #endif +#endif + +// Z Stepper +#if AXIS_IS_L64XX(Z) + extern L64XX_CLASS(Z) stepperZ; + #define Z_ENABLE_INIT NOOP + #define Z_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ.free()) + #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_Z(L6474) + #define Z_DIR_INIT SET_OUTPUT(Z_DIR_PIN) + #define Z_DIR_WRITE(STATE) L6474_DIR_WRITE(Z, STATE) + #define Z_DIR_READ READ(Z_DIR_PIN) + #else + #define Z_DIR_INIT NOOP + #define Z_DIR_WRITE(STATE) L64XX_DIR_WRITE(Z, STATE) + #define Z_DIR_READ (stepper##Z.getStatus() & STATUS_DIR); + #endif +#endif + +// X2 Stepper +#if HAS_X2_ENABLE && AXIS_IS_L64XX(X2) + extern L64XX_CLASS(X2) stepperX2; + #define X2_ENABLE_INIT NOOP + #define X2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperX2.free()) + #define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_X2(L6474) + #define X2_DIR_INIT SET_OUTPUT(X2_DIR_PIN) + #define X2_DIR_WRITE(STATE) L6474_DIR_WRITE(X2, STATE) + #define X2_DIR_READ READ(X2_DIR_PIN) + #else + #define X2_DIR_INIT NOOP + #define X2_DIR_WRITE(STATE) L64XX_DIR_WRITE(X2, STATE) + #define X2_DIR_READ (stepper##X2.getStatus() & STATUS_DIR); + #endif +#endif + +// Y2 Stepper +#if HAS_Y2_ENABLE && AXIS_IS_L64XX(Y2) + extern L64XX_CLASS(Y2) stepperY2; + #define Y2_ENABLE_INIT NOOP + #define Y2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperY2.free()) + #define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_Y2(L6474) + #define Y2_DIR_INIT SET_OUTPUT(Y2_DIR_PIN) + #define Y2_DIR_WRITE(STATE) L6474_DIR_WRITE(Y2, STATE) + #define Y2_DIR_READ READ(Y2_DIR_PIN) + #else + #define Y2_DIR_INIT NOOP + #define Y2_DIR_WRITE(STATE) L64XX_DIR_WRITE(Y2, STATE) + #define Y2_DIR_READ (stepper##Y2.getStatus() & STATUS_DIR); + #endif +#endif + +// Z2 Stepper +#if HAS_Z2_ENABLE && AXIS_IS_L64XX(Z2) + extern L64XX_CLASS(Z2) stepperZ2; + #define Z2_ENABLE_INIT NOOP + #define Z2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ2.free()) + #define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_Z2(L6474) + #define Z2_DIR_INIT SET_OUTPUT(Z2_DIR_PIN) + #define Z2_DIR_WRITE(STATE) L6474_DIR_WRITE(Z2, STATE) + #define Z2_DIR_READ READ(Z2_DIR_PIN) + #else + #define Z2_DIR_INIT NOOP + #define Z2_DIR_WRITE(STATE) L64XX_DIR_WRITE(Z2, STATE) + #define Z2_DIR_READ (stepper##Z2.getStatus() & STATUS_DIR); + #endif +#endif + +// Z3 Stepper +#if HAS_Z3_ENABLE && AXIS_IS_L64XX(Z3) + extern L64XX_CLASS(Z3) stepperZ3; + #define Z3_ENABLE_INIT NOOP + #define Z3_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ3.free()) + #define Z3_ENABLE_READ (stepperZ3.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_Z3(L6474) + #define Z3_DIR_INIT SET_OUTPUT(Z3_DIR_PIN) + #define Z3_DIR_WRITE(STATE) L6474_DIR_WRITE(Z3, STATE) + #define Z3_DIR_READ READ(Z3_DIR_PIN) + #else + #define Z3_DIR_INIT NOOP + #define Z3_DIR_WRITE(STATE) L64XX_DIR_WRITE(Z3, STATE) + #define Z3_DIR_READ (stepper##Z3.getStatus() & STATUS_DIR); + #endif +#endif + +// E0 Stepper +#if AXIS_IS_L64XX(E0) + extern L64XX_CLASS(E0) stepperE0; + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE0.free()) + #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_E0(L6474) + #define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN) + #define E0_DIR_WRITE(STATE) L6474_DIR_WRITE(E0, STATE) + #define E0_DIR_READ READ(E0_DIR_PIN) + #else + #define E0_DIR_INIT NOOP + #define E0_DIR_WRITE(STATE) L64XX_DIR_WRITE(E0, STATE) + #define E0_DIR_READ (stepper##E0.getStatus() & STATUS_DIR); + #endif +#endif + +// E1 Stepper +#if AXIS_IS_L64XX(E1) + extern L64XX_CLASS(E1) stepperE1; + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE1.free()) + #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_E1(L6474) + #define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN) + #define E1_DIR_WRITE(STATE) L6474_DIR_WRITE(E1, STATE) + #define E1_DIR_READ READ(E1_DIR_PIN) + #else + #define E1_DIR_INIT NOOP + #define E1_DIR_WRITE(STATE) L64XX_DIR_WRITE(E1, STATE) + #define E1_DIR_READ (stepper##E1.getStatus() & STATUS_DIR); + #endif +#endif + +// E2 Stepper +#if AXIS_IS_L64XX(E2) + extern L64XX_CLASS(E2) stepperE2; + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE2.free()) + #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_E2(L6474) + #define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN) + #define E2_DIR_WRITE(STATE) L6474_DIR_WRITE(E2, STATE) + #define E2_DIR_READ READ(E2_DIR_PIN) + #else + #define E2_DIR_INIT NOOP + #define E2_DIR_WRITE(STATE) L64XX_DIR_WRITE(E2, STATE) + #define E2_DIR_READ (stepper##E2.getStatus() & STATUS_DIR); + #endif +#endif + +// E3 Stepper +#if AXIS_IS_L64XX(E3) + extern L64XX_CLASS(E3) stepperE3; + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE3.free()) + #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_E3(L6474) + #define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN) + #define E3_DIR_WRITE(STATE) L6474_DIR_WRITE(E3, STATE) + #define E3_DIR_READ READ(E3_DIR_PIN) + #else + #define E3_DIR_INIT NOOP + #define E3_DIR_WRITE(STATE) L64XX_DIR_WRITE(E3, STATE) + #define E3_DIR_READ (stepper##E3.getStatus() & STATUS_DIR); + #endif +#endif + +// E4 Stepper +#if AXIS_IS_L64XX(E4) + extern L64XX_CLASS(E4) stepperE4; + #define E4_ENABLE_INIT NOOP + #define E4_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE4.free()) + #define E4_ENABLE_READ (stepperE4.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_E4(L6474) + #define E4_DIR_INIT SET_OUTPUT(E4_DIR_PIN) + #define E4_DIR_WRITE(STATE) L6474_DIR_WRITE(E4, STATE) + #define E4_DIR_READ READ(E4_DIR_PIN) + #else + #define E4_DIR_INIT NOOP + #define E4_DIR_WRITE(STATE) L64XX_DIR_WRITE(E4, STATE) + #define E4_DIR_READ (stepper##E4.getStatus() & STATUS_DIR); + #endif +#endif + +// E5 Stepper +#if AXIS_IS_L64XX(E5) + extern L64XX_CLASS(E5) stepperE5; + #define E5_ENABLE_INIT NOOP + #define E5_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE5.free()) + #define E5_ENABLE_READ (stepperE5.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_E5(L6474) + #define E5_DIR_INIT SET_OUTPUT(E5_DIR_PIN) + #define E5_DIR_WRITE(STATE) L6474_DIR_WRITE(E5, STATE) + #define E5_DIR_READ READ(E5_DIR_PIN) + #else + #define E5_DIR_INIT NOOP + #define E5_DIR_WRITE(STATE) L64XX_DIR_WRITE(E5, STATE) + #define E5_DIR_READ (stepper##E5.getStatus() & STATUS_DIR); + #endif +#endif diff --git a/Marlin/src/module/stepper/indirection.cpp b/Marlin/src/module/stepper/indirection.cpp index 2037c1b84e..f784d4911c 100644 --- a/Marlin/src/module/stepper/indirection.cpp +++ b/Marlin/src/module/stepper/indirection.cpp @@ -43,8 +43,8 @@ void reset_stepper_drivers() { tmc26x_init_to_defaults(); #endif - #if HAS_DRIVER(L6470) - L6470.init_to_defaults(); + #if HAS_L64XX + L64xxManager.init_to_defaults(); #endif #if HAS_TRINAMIC diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index ed87fde83c..05a5e545c6 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -32,8 +32,8 @@ #include "../../inc/MarlinConfig.h" -#if HAS_DRIVER(L6470) - #include "L6470.h" +#if HAS_L64XX + #include "L64xx.h" #endif #if HAS_DRIVER(TMC26X) diff --git a/buildroot/share/tests/megaatmega2560-tests b/buildroot/share/tests/megaatmega2560-tests index 16db670225..20379c408e 100755 --- a/buildroot/share/tests/megaatmega2560-tests +++ b/buildroot/share/tests/megaatmega2560-tests @@ -297,8 +297,16 @@ exec_test $1 $2 "Full-featured CR-10S config" # Delta Config (generic) + ABL bilinear + BLTOUCH use_example_configs delta/generic opt_set LCD_LANGUAGE cz +opt_set X_DRIVER_TYPE L6470 +opt_set Y_DRIVER_TYPE L6470 +opt_set Z_DRIVER_TYPE L6470 +opt_add L6470_CHAIN_SCK_PIN 53 +opt_add L6470_CHAIN_MISO_PIN 49 +opt_add L6470_CHAIN_MOSI_PIN 40 +opt_add L6470_CHAIN_SS_PIN 42 +opt_add "ENABLE_RESET_L64XX_CHIPS(V) NOOP" opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR BLTOUCH -exec_test $1 $2 "RAMPS | DELTA | RRD LCD | ABL Bilinear | BLTOUCH" +exec_test $1 $2 "DELTA | L6470 | RRD LCD | ABL Bilinear | BLTOUCH" # # Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS diff --git a/config/default/Configuration.h b/config/default/Configuration.h index 7a6e43c7a8..ee82fbf9f3 100644 --- a/config/default/Configuration.h +++ b/config/default/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_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 95fae1ec26..4685198fc2 100644 --- a/config/default/Configuration_adv.h +++ b/config/default/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/3DFabXYZ/Migbot/Configuration.h b/config/examples/3DFabXYZ/Migbot/Configuration.h index 716dbc8de3..0d322f8932 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration.h @@ -660,12 +660,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 dec504445c..fa78b0b04f 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/ADIMLab/Gantry v1/Configuration.h b/config/examples/ADIMLab/Gantry v1/Configuration.h index c6a1e9532b..746c442074 100644 --- a/config/examples/ADIMLab/Gantry v1/Configuration.h +++ b/config/examples/ADIMLab/Gantry v1/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/ADIMLab/Gantry v1/Configuration_adv.h b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h index bb15b0d445..1aefeb219a 100644 --- a/config/examples/ADIMLab/Gantry v1/Configuration_adv.h +++ b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/ADIMLab/Gantry v2/Configuration.h b/config/examples/ADIMLab/Gantry v2/Configuration.h index ce738a985b..9a9d683077 100644 --- a/config/examples/ADIMLab/Gantry v2/Configuration.h +++ b/config/examples/ADIMLab/Gantry v2/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/ADIMLab/Gantry v2/Configuration_adv.h b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h index 09306ce9d1..e1ad356e2a 100644 --- a/config/examples/ADIMLab/Gantry v2/Configuration_adv.h +++ b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 b9008fbb77..8ea42c7878 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/config/examples/AlephObjects/TAZ4/Configuration.h @@ -674,12 +674,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 7b29fec446..77ed861498 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Alfawise/U20-bltouch/Configuration.h b/config/examples/Alfawise/U20-bltouch/Configuration.h index 3c6a3db3ec..10ff1d1489 100644 --- a/config/examples/Alfawise/U20-bltouch/Configuration.h +++ b/config/examples/Alfawise/U20-bltouch/Configuration.h @@ -717,12 +717,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Alfawise/U20-bltouch/Configuration_adv.h b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h index f8ad2d48b7..5151a8f2c4 100644 --- a/config/examples/Alfawise/U20-bltouch/Configuration_adv.h +++ b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Alfawise/U20/Configuration.h b/config/examples/Alfawise/U20/Configuration.h index 3b30f61497..cf218cde10 100644 --- a/config/examples/Alfawise/U20/Configuration.h +++ b/config/examples/Alfawise/U20/Configuration.h @@ -717,12 +717,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Alfawise/U20/Configuration_adv.h b/config/examples/Alfawise/U20/Configuration_adv.h index 1c611ac3e4..d6d6398445 100644 --- a/config/examples/Alfawise/U20/Configuration_adv.h +++ b/config/examples/Alfawise/U20/Configuration_adv.h @@ -2218,12 +2218,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2231,114 +2231,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2364,7 +2383,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 196e58b7b9..46c07524e1 100644 --- a/config/examples/AliExpress/CL-260/Configuration.h +++ b/config/examples/AliExpress/CL-260/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 12e2be329c..41215592ba 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration.h +++ b/config/examples/AliExpress/UM2pExt/Configuration.h @@ -665,12 +665,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 ce3cc0db22..9bf6ae9b29 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration_adv.h +++ b/config/examples/AliExpress/UM2pExt/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 ac083312c9..21c99dac50 100644 --- a/config/examples/Anet/A2/Configuration.h +++ b/config/examples/Anet/A2/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 d02c70d1dc..fa99f437b5 100644 --- a/config/examples/Anet/A2/Configuration_adv.h +++ b/config/examples/Anet/A2/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 5288e5ca59..f4f28ba97d 100644 --- a/config/examples/Anet/A2plus/Configuration.h +++ b/config/examples/Anet/A2plus/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 d02c70d1dc..fa99f437b5 100644 --- a/config/examples/Anet/A2plus/Configuration_adv.h +++ b/config/examples/Anet/A2plus/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 0cf608bbc3..ed50931da6 100644 --- a/config/examples/Anet/A6/Configuration.h +++ b/config/examples/Anet/A6/Configuration.h @@ -674,12 +674,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 a17b4043f6..6671e83c61 100644 --- a/config/examples/Anet/A6/Configuration_adv.h +++ b/config/examples/Anet/A6/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 8109ffab5f..bdf20253d2 100644 --- a/config/examples/Anet/A8/Configuration.h +++ b/config/examples/Anet/A8/Configuration.h @@ -667,12 +667,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 eeb2ae91dc..c42714b6bd 100644 --- a/config/examples/Anet/A8/Configuration_adv.h +++ b/config/examples/Anet/A8/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Anet/A8plus/Configuration.h b/config/examples/Anet/A8plus/Configuration.h index a8e3b99b1e..dc3ccfc9b0 100644 --- a/config/examples/Anet/A8plus/Configuration.h +++ b/config/examples/Anet/A8plus/Configuration.h @@ -665,12 +665,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/A8plus/Configuration_adv.h b/config/examples/Anet/A8plus/Configuration_adv.h index 46a97ff089..2ffcf18600 100644 --- a/config/examples/Anet/A8plus/Configuration_adv.h +++ b/config/examples/Anet/A8plus/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Anet/E10/Configuration.h b/config/examples/Anet/E10/Configuration.h index 07096c6b4d..732a63b91a 100644 --- a/config/examples/Anet/E10/Configuration.h +++ b/config/examples/Anet/E10/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/E10/Configuration_adv.h b/config/examples/Anet/E10/Configuration_adv.h index a5cbc0237e..324b422ff4 100644 --- a/config/examples/Anet/E10/Configuration_adv.h +++ b/config/examples/Anet/E10/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Anet/E16/Configuration.h b/config/examples/Anet/E16/Configuration.h index 22672e8353..040caf02ec 100644 --- a/config/examples/Anet/E16/Configuration.h +++ b/config/examples/Anet/E16/Configuration.h @@ -666,12 +666,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/E16/Configuration_adv.h b/config/examples/Anet/E16/Configuration_adv.h index 0f4a07dc1b..d3f3778222 100644 --- a/config/examples/Anet/E16/Configuration_adv.h +++ b/config/examples/Anet/E16/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 e2262761b7..ed84b0fa2f 100644 --- a/config/examples/AnyCubic/i3/Configuration.h +++ b/config/examples/AnyCubic/i3/Configuration.h @@ -664,12 +664,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 553a3be7d6..f6b397f93f 100644 --- a/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/config/examples/AnyCubic/i3/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 6d2532751f..eaacff7489 100644 --- a/config/examples/ArmEd/Configuration.h +++ b/config/examples/ArmEd/Configuration.h @@ -655,12 +655,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 2806517136..7122c40ca8 100644 --- a/config/examples/ArmEd/Configuration_adv.h +++ b/config/examples/ArmEd/Configuration_adv.h @@ -2221,12 +2221,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2234,114 +2234,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2367,7 +2386,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Artillery/Genius/Configuration.h b/config/examples/Artillery/Genius/Configuration.h index 1e2b1dcb06..a96559bf52 100644 --- a/config/examples/Artillery/Genius/Configuration.h +++ b/config/examples/Artillery/Genius/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC2100 #define Y_DRIVER_TYPE TMC2100 diff --git a/config/examples/Artillery/Genius/Configuration_adv.h b/config/examples/Artillery/Genius/Configuration_adv.h index 67b51dce64..06c7aa0990 100755 --- a/config/examples/Artillery/Genius/Configuration_adv.h +++ b/config/examples/Artillery/Genius/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Artillery/Sidewinder X1/Configuration.h b/config/examples/Artillery/Sidewinder X1/Configuration.h index 45dd5c6d80..736ba87c26 100644 --- a/config/examples/Artillery/Sidewinder X1/Configuration.h +++ b/config/examples/Artillery/Sidewinder X1/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC2100 #define Y_DRIVER_TYPE TMC2100 diff --git a/config/examples/Artillery/Sidewinder X1/Configuration_adv.h b/config/examples/Artillery/Sidewinder X1/Configuration_adv.h index 67b51dce64..06c7aa0990 100755 --- a/config/examples/Artillery/Sidewinder X1/Configuration_adv.h +++ b/config/examples/Artillery/Sidewinder X1/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 05c0e14db3..0f4bf6803d 100644 --- a/config/examples/Azteeg/X5GT/Configuration.h +++ b/config/examples/Azteeg/X5GT/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 b8a73d7c48..2928dd0c09 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 ad8f4a1172..e75c7d417e 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 b3dec5de8f..1fbf1f14b7 100644 --- a/config/examples/BIBO/TouchX/default/Configuration.h +++ b/config/examples/BIBO/TouchX/default/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 e1427621b8..dfaac32a06 100644 --- a/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 ac0b349af9..c3de2a0bef 100644 --- a/config/examples/BQ/Hephestos/Configuration.h +++ b/config/examples/BQ/Hephestos/Configuration.h @@ -642,12 +642,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 92138c763e..f27deb38c8 100644 --- a/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/config/examples/BQ/Hephestos/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 abbb436b10..6e8a356809 100644 --- a/config/examples/BQ/Hephestos_2/Configuration.h +++ b/config/examples/BQ/Hephestos_2/Configuration.h @@ -655,12 +655,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 9efd9070c3..65a3ccf5f6 100644 --- a/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -2225,12 +2225,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2238,114 +2238,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2371,7 +2390,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 482b090935..af2c579627 100644 --- a/config/examples/BQ/WITBOX/Configuration.h +++ b/config/examples/BQ/WITBOX/Configuration.h @@ -642,12 +642,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 92138c763e..f27deb38c8 100644 --- a/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/config/examples/BQ/WITBOX/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h b/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h index 74f8c771be..a1f2a07a6d 100644 --- a/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h +++ b/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h @@ -646,12 +646,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC2209 #define Y_DRIVER_TYPE TMC2209 diff --git a/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h b/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h index 4b36b1838e..e81b1a7c71 100644 --- a/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h +++ b/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h b/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h index fb35f26f78..ecbbee0c96 100644 --- a/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h +++ b/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h @@ -647,12 +647,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC2209 #define Y_DRIVER_TYPE TMC2209 diff --git a/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h b/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h index 24c729be84..1b182ac657 100644 --- a/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h +++ b/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 03e2539e97..2dfc3e915b 100644 --- a/config/examples/Cartesio/Configuration.h +++ b/config/examples/Cartesio/Configuration.h @@ -653,12 +653,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 174441db99..dc0bf2237e 100644 --- a/config/examples/Cartesio/Configuration_adv.h +++ b/config/examples/Cartesio/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 25f1feac4b..034f647a0e 100644 --- a/config/examples/Creality/CR-10/Configuration.h +++ b/config/examples/Creality/CR-10/Configuration.h @@ -664,12 +664,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 b2dff44540..ca0299ca87 100644 --- a/config/examples/Creality/CR-10/Configuration_adv.h +++ b/config/examples/Creality/CR-10/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 545d5a81b1..362ed7dc71 100644 --- a/config/examples/Creality/CR-10S/Configuration.h +++ b/config/examples/Creality/CR-10S/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 173d2d3d80..8ee60af5c6 100644 --- a/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 d28a3d3543..8c376579b1 100644 --- a/config/examples/Creality/CR-10_5S/Configuration.h +++ b/config/examples/Creality/CR-10_5S/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 366a785df3..4f08ea4957 100644 --- a/config/examples/Creality/CR-10_5S/Configuration_adv.h +++ b/config/examples/Creality/CR-10_5S/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 3d9c33d909..93d74dbf60 100644 --- a/config/examples/Creality/CR-10mini/Configuration.h +++ b/config/examples/Creality/CR-10mini/Configuration.h @@ -673,12 +673,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 73c5cba955..52e070fd0a 100644 --- a/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/CR-20 Pro/Configuration.h b/config/examples/Creality/CR-20 Pro/Configuration.h index 2fbeaff254..6bc655ef1b 100644 --- a/config/examples/Creality/CR-20 Pro/Configuration.h +++ b/config/examples/Creality/CR-20 Pro/Configuration.h @@ -658,12 +658,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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-20 Pro/Configuration_adv.h b/config/examples/Creality/CR-20 Pro/Configuration_adv.h index 0c1e3104d5..82d3b34dd4 100644 --- a/config/examples/Creality/CR-20 Pro/Configuration_adv.h +++ b/config/examples/Creality/CR-20 Pro/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/CR-20/Configuration.h b/config/examples/Creality/CR-20/Configuration.h index 17829b7e37..5a0fb8dbef 100644 --- a/config/examples/Creality/CR-20/Configuration.h +++ b/config/examples/Creality/CR-20/Configuration.h @@ -658,12 +658,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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-20/Configuration_adv.h b/config/examples/Creality/CR-20/Configuration_adv.h index 2516c92ae4..a5e4b9ebd3 100644 --- a/config/examples/Creality/CR-20/Configuration_adv.h +++ b/config/examples/Creality/CR-20/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 4eef47832d..3cc9dccd85 100644 --- a/config/examples/Creality/CR-8/Configuration.h +++ b/config/examples/Creality/CR-8/Configuration.h @@ -664,12 +664,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 a42ec5856d..e760d93638 100644 --- a/config/examples/Creality/CR-8/Configuration_adv.h +++ b/config/examples/Creality/CR-8/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 8ed55df91e..c9a9f879bd 100644 --- a/config/examples/Creality/Ender-2/Configuration.h +++ b/config/examples/Creality/Ender-2/Configuration.h @@ -658,12 +658,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 9de532adfb..a2000e7331 100644 --- a/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/config/examples/Creality/Ender-2/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 04f4c59aec..b6ee81f6f8 100644 --- a/config/examples/Creality/Ender-3/Configuration.h +++ b/config/examples/Creality/Ender-3/Configuration.h @@ -658,12 +658,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 01161882c3..18a67eb87e 100644 --- a/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 c369947a96..49605342b0 100644 --- a/config/examples/Creality/Ender-4/Configuration.h +++ b/config/examples/Creality/Ender-4/Configuration.h @@ -664,12 +664,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 f7fb8af014..f0cdde0e22 100644 --- a/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/config/examples/Creality/Ender-4/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/Ender-5 Pro/Configuration.h b/config/examples/Creality/Ender-5 Pro/Configuration.h index 67dcf9c984..f18c2fe03d 100644 --- a/config/examples/Creality/Ender-5 Pro/Configuration.h +++ b/config/examples/Creality/Ender-5 Pro/Configuration.h @@ -658,12 +658,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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-5 Pro/Configuration_adv.h b/config/examples/Creality/Ender-5 Pro/Configuration_adv.h index d866835671..a477c3bfbd 100644 --- a/config/examples/Creality/Ender-5 Pro/Configuration_adv.h +++ b/config/examples/Creality/Ender-5 Pro/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Creality/Ender-5/Configuration.h b/config/examples/Creality/Ender-5/Configuration.h index 02f39f163b..2b29bb8c9c 100644 --- a/config/examples/Creality/Ender-5/Configuration.h +++ b/config/examples/Creality/Ender-5/Configuration.h @@ -658,12 +658,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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-5/Configuration_adv.h b/config/examples/Creality/Ender-5/Configuration_adv.h index 366a23933e..da405f0bdd 100644 --- a/config/examples/Creality/Ender-5/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Dagoma/Disco Ultimate/Configuration.h b/config/examples/Dagoma/Disco Ultimate/Configuration.h index 779b12e937..b77f83fa62 100644 --- a/config/examples/Dagoma/Disco Ultimate/Configuration.h +++ b/config/examples/Dagoma/Disco Ultimate/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A5984 #define Y_DRIVER_TYPE A5984 diff --git a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h index dd118bd119..f8db8a46d3 100644 --- a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h +++ b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/EXP3D/Imprimante multifonction/Configuration.h b/config/examples/EXP3D/Imprimante multifonction/Configuration.h index 53918b9580..45651b5e19 100644 --- a/config/examples/EXP3D/Imprimante multifonction/Configuration.h +++ b/config/examples/EXP3D/Imprimante multifonction/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h b/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h index 4cd8775b22..05a7371ab5 100644 --- a/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h +++ b/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h @@ -2213,12 +2213,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2226,114 +2226,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2359,7 +2378,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 d120ccf124..94b5750491 100644 --- a/config/examples/Einstart-S/Configuration.h +++ b/config/examples/Einstart-S/Configuration.h @@ -664,12 +664,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 df8e739fd7..5e231153c7 100644 --- a/config/examples/Einstart-S/Configuration_adv.h +++ b/config/examples/Einstart-S/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/FYSETC/AIO_II/Configuration.h b/config/examples/FYSETC/AIO_II/Configuration.h index b73c6dfdd8..47c9cf8cc0 100644 --- a/config/examples/FYSETC/AIO_II/Configuration.h +++ b/config/examples/FYSETC/AIO_II/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/FYSETC/AIO_II/Configuration_adv.h b/config/examples/FYSETC/AIO_II/Configuration_adv.h index 2efd4f0269..d422a4aaa8 100644 --- a/config/examples/FYSETC/AIO_II/Configuration_adv.h +++ b/config/examples/FYSETC/AIO_II/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h index ed6372b35e..d9f7d4a7f0 100644 --- a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h +++ b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC2208 #define Y_DRIVER_TYPE TMC2208 diff --git a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h index 363fb25e16..4c424932c6 100644 --- a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h b/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h index 55cb74bd98..4b1e859124 100644 --- a/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h +++ b/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC2208 #define Y_DRIVER_TYPE TMC2208 diff --git a/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h b/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h index 363fb25e16..4c424932c6 100644 --- a/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h b/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h index 95a9576f88..5fbb80acee 100644 --- a/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h +++ b/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC2209 #define Y_DRIVER_TYPE TMC2209 diff --git a/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h b/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h index 363fb25e16..4c424932c6 100644 --- a/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/FYSETC/Cheetah/base/Configuration.h b/config/examples/FYSETC/Cheetah/base/Configuration.h index e7e8bd860f..8e217485f6 100644 --- a/config/examples/FYSETC/Cheetah/base/Configuration.h +++ b/config/examples/FYSETC/Cheetah/base/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC2209 #define Y_DRIVER_TYPE TMC2209 diff --git a/config/examples/FYSETC/Cheetah/base/Configuration_adv.h b/config/examples/FYSETC/Cheetah/base/Configuration_adv.h index 363fb25e16..4c424932c6 100644 --- a/config/examples/FYSETC/Cheetah/base/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah/base/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/FYSETC/F6_13/Configuration.h b/config/examples/FYSETC/F6_13/Configuration.h index 1ad33dc795..3e06d9df70 100644 --- a/config/examples/FYSETC/F6_13/Configuration.h +++ b/config/examples/FYSETC/F6_13/Configuration.h @@ -656,12 +656,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/FYSETC/F6_13/Configuration_adv.h b/config/examples/FYSETC/F6_13/Configuration_adv.h index 5cac06aaba..2ff75b6e9b 100644 --- a/config/examples/FYSETC/F6_13/Configuration_adv.h +++ b/config/examples/FYSETC/F6_13/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/FYSETC/S6/Configuration.h b/config/examples/FYSETC/S6/Configuration.h index fb12f52530..beb9a8a300 100644 --- a/config/examples/FYSETC/S6/Configuration.h +++ b/config/examples/FYSETC/S6/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/FYSETC/S6/Configuration_adv.h b/config/examples/FYSETC/S6/Configuration_adv.h index 95fae1ec26..4685198fc2 100644 --- a/config/examples/FYSETC/S6/Configuration_adv.h +++ b/config/examples/FYSETC/S6/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 698b459860..8e43970b49 100644 --- a/config/examples/Felix/DUAL/Configuration.h +++ b/config/examples/Felix/DUAL/Configuration.h @@ -635,12 +635,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/DUAL/Configuration_adv.h b/config/examples/Felix/DUAL/Configuration_adv.h index 3d7683ab5a..96b40e3df7 100644 --- a/config/examples/Felix/DUAL/Configuration_adv.h +++ b/config/examples/Felix/DUAL/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Felix/Single/Configuration.h b/config/examples/Felix/Single/Configuration.h index dc6943cd9b..e7cae9ac5e 100644 --- a/config/examples/Felix/Single/Configuration.h +++ b/config/examples/Felix/Single/Configuration.h @@ -635,12 +635,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/Single/Configuration_adv.h b/config/examples/Felix/Single/Configuration_adv.h index 3d7683ab5a..96b40e3df7 100644 --- a/config/examples/Felix/Single/Configuration_adv.h +++ b/config/examples/Felix/Single/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/FlashForge/CreatorPro/Configuration.h b/config/examples/FlashForge/CreatorPro/Configuration.h index 856dd9f498..70f9cacd15 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration.h +++ b/config/examples/FlashForge/CreatorPro/Configuration.h @@ -644,12 +644,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 f5b3583501..c32ede7a9b 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -2216,12 +2216,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2229,114 +2229,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2362,7 +2381,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 e949d966e4..bb57f3f977 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration.h +++ b/config/examples/FolgerTech/i3-2020/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 a0fb52a45d..4685e4c973 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 49275fa931..257695703a 100644 --- a/config/examples/Formbot/Raptor/Configuration.h +++ b/config/examples/Formbot/Raptor/Configuration.h @@ -708,12 +708,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 6596a1efb8..331521f70d 100644 --- a/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/config/examples/Formbot/Raptor/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 1fa1ea7130..1a09e51bc0 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration.h @@ -683,12 +683,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 70002e20b3..2dbebf23d8 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -2221,12 +2221,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2234,114 +2234,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2367,7 +2386,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 9ebd41c695..0f2b5c3211 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration.h +++ b/config/examples/Formbot/T_Rex_3/Configuration.h @@ -663,12 +663,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 cd315780e4..609bbda205 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -2221,12 +2221,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2234,114 +2234,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2367,7 +2386,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/A10/Configuration.h b/config/examples/Geeetech/A10/Configuration.h index a7deecff2f..ee1994aab8 100644 --- a/config/examples/Geeetech/A10/Configuration.h +++ b/config/examples/Geeetech/A10/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/A10/Configuration_adv.h b/config/examples/Geeetech/A10/Configuration_adv.h index a6b97e9415..f41bcc8a7a 100644 --- a/config/examples/Geeetech/A10/Configuration_adv.h +++ b/config/examples/Geeetech/A10/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/A10D/Configuration.h b/config/examples/Geeetech/A10D/Configuration.h index 4f9a839a16..faec3dbec1 100644 --- a/config/examples/Geeetech/A10D/Configuration.h +++ b/config/examples/Geeetech/A10D/Configuration.h @@ -636,12 +636,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/A10D/Configuration_adv.h b/config/examples/Geeetech/A10D/Configuration_adv.h index 191c382f8c..01f633bd59 100644 --- a/config/examples/Geeetech/A10D/Configuration_adv.h +++ b/config/examples/Geeetech/A10D/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 c2c8185c6c..9c7baa6872 100644 --- a/config/examples/Geeetech/A10M/Configuration.h +++ b/config/examples/Geeetech/A10M/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 71536defb9..11ad33e40e 100644 --- a/config/examples/Geeetech/A10M/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/A10T/Configuration.h b/config/examples/Geeetech/A10T/Configuration.h index fb8e2a00a9..e576dc732e 100644 --- a/config/examples/Geeetech/A10T/Configuration.h +++ b/config/examples/Geeetech/A10T/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/A10T/Configuration_adv.h b/config/examples/Geeetech/A10T/Configuration_adv.h index 71536defb9..11ad33e40e 100644 --- a/config/examples/Geeetech/A10T/Configuration_adv.h +++ b/config/examples/Geeetech/A10T/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/A20/Configuration.h b/config/examples/Geeetech/A20/Configuration.h index f853ca3039..37e6aaafe9 100644 --- a/config/examples/Geeetech/A20/Configuration.h +++ b/config/examples/Geeetech/A20/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/A20/Configuration_adv.h b/config/examples/Geeetech/A20/Configuration_adv.h index cd47b6b988..99a780eae5 100644 --- a/config/examples/Geeetech/A20/Configuration_adv.h +++ b/config/examples/Geeetech/A20/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 37b16fd217..7214c15cdc 100644 --- a/config/examples/Geeetech/A20M/Configuration.h +++ b/config/examples/Geeetech/A20M/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 cd47b6b988..99a780eae5 100644 --- a/config/examples/Geeetech/A20M/Configuration_adv.h +++ b/config/examples/Geeetech/A20M/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/A20T/Configuration.h b/config/examples/Geeetech/A20T/Configuration.h index 7bafda3b10..7cb09d6b18 100644 --- a/config/examples/Geeetech/A20T/Configuration.h +++ b/config/examples/Geeetech/A20T/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/A20T/Configuration_adv.h b/config/examples/Geeetech/A20T/Configuration_adv.h index cd47b6b988..99a780eae5 100644 --- a/config/examples/Geeetech/A20T/Configuration_adv.h +++ b/config/examples/Geeetech/A20T/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/A30/Configuration.h b/config/examples/Geeetech/A30/Configuration.h index 0c79e03a79..4b85a1c02f 100644 --- a/config/examples/Geeetech/A30/Configuration.h +++ b/config/examples/Geeetech/A30/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/A30/Configuration_adv.h b/config/examples/Geeetech/A30/Configuration_adv.h index b533de039b..74307076c9 100644 --- a/config/examples/Geeetech/A30/Configuration_adv.h +++ b/config/examples/Geeetech/A30/Configuration_adv.h @@ -2216,12 +2216,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2229,114 +2229,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2362,7 +2381,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/D200/Configuration.h b/config/examples/Geeetech/D200/Configuration.h index a0dba40fc3..343b212ed2 100644 --- a/config/examples/Geeetech/D200/Configuration.h +++ b/config/examples/Geeetech/D200/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/D200/Configuration_adv.h b/config/examples/Geeetech/D200/Configuration_adv.h index 13b57e0013..a224e65e39 100644 --- a/config/examples/Geeetech/D200/Configuration_adv.h +++ b/config/examples/Geeetech/D200/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/E180/Configuration.h b/config/examples/Geeetech/E180/Configuration.h index ae1dd59292..65d6c6f4b3 100644 --- a/config/examples/Geeetech/E180/Configuration.h +++ b/config/examples/Geeetech/E180/Configuration.h @@ -638,12 +638,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/E180/Configuration_adv.h b/config/examples/Geeetech/E180/Configuration_adv.h index b533de039b..74307076c9 100644 --- a/config/examples/Geeetech/E180/Configuration_adv.h +++ b/config/examples/Geeetech/E180/Configuration_adv.h @@ -2216,12 +2216,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2229,114 +2229,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2362,7 +2381,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 7f22f33230..17e49e8f4d 100644 --- a/config/examples/Geeetech/GT2560/Configuration.h +++ b/config/examples/Geeetech/GT2560/Configuration.h @@ -669,12 +669,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 f88ebc1061..a36e0a1aa1 100644 --- a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/M201/Configuration.h b/config/examples/Geeetech/M201/Configuration.h index ef3676fb97..7d5871a80c 100644 --- a/config/examples/Geeetech/M201/Configuration.h +++ b/config/examples/Geeetech/M201/Configuration.h @@ -637,12 +637,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/M201/Configuration_adv.h b/config/examples/Geeetech/M201/Configuration_adv.h index 13b57e0013..a224e65e39 100644 --- a/config/examples/Geeetech/M201/Configuration_adv.h +++ b/config/examples/Geeetech/M201/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/MeCreator2/Configuration.h b/config/examples/Geeetech/MeCreator2/Configuration.h index b0ef90dcf1..89003c998c 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration.h +++ b/config/examples/Geeetech/MeCreator2/Configuration.h @@ -661,12 +661,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 0af215f8e5..dec4ee4c94 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -2216,12 +2216,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2229,114 +2229,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2362,7 +2381,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Geeetech/PI3A PRO/Configuration.h b/config/examples/Geeetech/PI3A PRO/Configuration.h index c8f100c1f1..6df5557a96 100644 --- a/config/examples/Geeetech/PI3A PRO/Configuration.h +++ b/config/examples/Geeetech/PI3A PRO/Configuration.h @@ -670,12 +670,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/PI3A PRO/Configuration_adv.h b/config/examples/Geeetech/PI3A PRO/Configuration_adv.h index 5b26565dab..5b1e5e4444 100644 --- a/config/examples/Geeetech/PI3A PRO/Configuration_adv.h +++ b/config/examples/Geeetech/PI3A PRO/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 9825dda59b..a0f95d39e2 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -669,12 +669,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 70d8021f74..53fb87f01d 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -669,12 +669,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 bb80aef8a7..79b3234d0f 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 a6b97e9415..f41bcc8a7a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 bc5ede5e02..066811487a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 a6b97e9415..f41bcc8a7a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/HMS434/Configuration.h b/config/examples/HMS434/Configuration.h index acbb3addd9..43cd5c8e5d 100644 --- a/config/examples/HMS434/Configuration.h +++ b/config/examples/HMS434/Configuration.h @@ -643,12 +643,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/HMS434/Configuration_adv.h b/config/examples/HMS434/Configuration_adv.h index 6ad84a0c61..bcd4e29e95 100644 --- a/config/examples/HMS434/Configuration_adv.h +++ b/config/examples/HMS434/Configuration_adv.h @@ -2209,12 +2209,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2222,114 +2222,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2355,7 +2374,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 20a9b0ca3e..e49da86312 100644 --- a/config/examples/Infitary/i3-M508/Configuration.h +++ b/config/examples/Infitary/i3-M508/Configuration.h @@ -658,12 +658,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 3c96537af9..efd8a96068 100644 --- a/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/JGAurora/A1/Configuration.h b/config/examples/JGAurora/A1/Configuration.h index 4a05d5fc25..cf167f61d7 100644 --- a/config/examples/JGAurora/A1/Configuration.h +++ b/config/examples/JGAurora/A1/Configuration.h @@ -661,12 +661,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/A1/Configuration_adv.h b/config/examples/JGAurora/A1/Configuration_adv.h index 54709bc5ff..b08bd3635a 100644 --- a/config/examples/JGAurora/A1/Configuration_adv.h +++ b/config/examples/JGAurora/A1/Configuration_adv.h @@ -2222,12 +2222,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2235,114 +2235,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2368,7 +2387,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 6ce742d224..dd22fb8c8d 100644 --- a/config/examples/JGAurora/A5/Configuration.h +++ b/config/examples/JGAurora/A5/Configuration.h @@ -666,12 +666,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 afff7b0875..622399f34f 100644 --- a/config/examples/JGAurora/A5/Configuration_adv.h +++ b/config/examples/JGAurora/A5/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/JGAurora/A5S/Configuration.h b/config/examples/JGAurora/A5S/Configuration.h index a977df4082..6b1835a874 100644 --- a/config/examples/JGAurora/A5S/Configuration.h +++ b/config/examples/JGAurora/A5S/Configuration.h @@ -661,12 +661,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/A5S/Configuration_adv.h b/config/examples/JGAurora/A5S/Configuration_adv.h index 54709bc5ff..b08bd3635a 100644 --- a/config/examples/JGAurora/A5S/Configuration_adv.h +++ b/config/examples/JGAurora/A5S/Configuration_adv.h @@ -2222,12 +2222,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2235,114 +2235,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2368,7 +2387,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/JGAurora/Magic/Configuration.h b/config/examples/JGAurora/Magic/Configuration.h index 08ed04fef7..9700100e0d 100644 --- a/config/examples/JGAurora/Magic/Configuration.h +++ b/config/examples/JGAurora/Magic/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/Magic/Configuration_adv.h b/config/examples/JGAurora/Magic/Configuration_adv.h index f20ff28a7b..446e0f0589 100644 --- a/config/examples/JGAurora/Magic/Configuration_adv.h +++ b/config/examples/JGAurora/Magic/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/MakerFarm/Pegasus_12/Configuration.h b/config/examples/MakerFarm/Pegasus_12/Configuration.h index 112e2cc306..da1f61dd71 100644 --- a/config/examples/MakerFarm/Pegasus_12/Configuration.h +++ b/config/examples/MakerFarm/Pegasus_12/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/MakerFarm/Pegasus_12/Configuration_adv.h b/config/examples/MakerFarm/Pegasus_12/Configuration_adv.h index 34761abb76..dee11e9c6e 100644 --- a/config/examples/MakerFarm/Pegasus_12/Configuration_adv.h +++ b/config/examples/MakerFarm/Pegasus_12/Configuration_adv.h @@ -2213,12 +2213,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2226,114 +2226,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2359,7 +2378,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 e3e3480777..ebbf1e731c 100644 --- a/config/examples/MakerParts/Configuration.h +++ b/config/examples/MakerParts/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 fba84c4bb2..31b4a82216 100644 --- a/config/examples/MakerParts/Configuration_adv.h +++ b/config/examples/MakerParts/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 68657b3130..82c8168755 100644 --- a/config/examples/Malyan/M150/Configuration.h +++ b/config/examples/Malyan/M150/Configuration.h @@ -663,12 +663,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 93b15eda60..137da9fcca 100644 --- a/config/examples/Malyan/M150/Configuration_adv.h +++ b/config/examples/Malyan/M150/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 bce26c8c85..8af0e8c3d4 100644 --- a/config/examples/Malyan/M200/Configuration.h +++ b/config/examples/Malyan/M200/Configuration.h @@ -664,12 +664,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 43e119173c..222ec28e2d 100644 --- a/config/examples/Malyan/M200/Configuration_adv.h +++ b/config/examples/Malyan/M200/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 e9d5f9a59f..cf925b6ccd 100644 --- a/config/examples/Micromake/C1/basic/Configuration.h +++ b/config/examples/Micromake/C1/basic/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 c79313a28b..d8c5b2149c 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/config/examples/Micromake/C1/enhanced/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 33f1209252..94d4d20345 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 c7461ab618..dcf7608f0b 100644 --- a/config/examples/Mks/Robin/Configuration.h +++ b/config/examples/Mks/Robin/Configuration.h @@ -655,12 +655,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 a4bb84cbb9..fa1151064d 100644 --- a/config/examples/Mks/Robin/Configuration_adv.h +++ b/config/examples/Mks/Robin/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Mks/Robin_Lite3/Configuration.h b/config/examples/Mks/Robin_Lite3/Configuration.h index 32a6a75270..865c146ec8 100644 --- a/config/examples/Mks/Robin_Lite3/Configuration.h +++ b/config/examples/Mks/Robin_Lite3/Configuration.h @@ -661,12 +661,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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_Pro/Configuration.h b/config/examples/Mks/Robin_Pro/Configuration.h index 819da9ab90..46a6f866ad 100644 --- a/config/examples/Mks/Robin_Pro/Configuration.h +++ b/config/examples/Mks/Robin_Pro/Configuration.h @@ -660,12 +660,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/Sbase/Configuration.h b/config/examples/Mks/Sbase/Configuration.h index c475c3fac3..79575d5de7 100644 --- a/config/examples/Mks/Sbase/Configuration.h +++ b/config/examples/Mks/Sbase/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_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 c93e901ff1..9a4d18e5ee 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -2218,12 +2218,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2231,114 +2231,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2364,7 +2383,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Modix/Big60/Configuration.h b/config/examples/Modix/Big60/Configuration.h index dc00a54da9..e96183b342 100644 --- a/config/examples/Modix/Big60/Configuration.h +++ b/config/examples/Modix/Big60/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Modix/Big60/Configuration_adv.h b/config/examples/Modix/Big60/Configuration_adv.h index 7ab97f0d3a..f498b24267 100644 --- a/config/examples/Modix/Big60/Configuration_adv.h +++ b/config/examples/Modix/Big60/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 e2bc192e95..3400811fb9 100644 --- a/config/examples/Printrbot/PrintrboardG2/Configuration.h +++ b/config/examples/Printrbot/PrintrboardG2/Configuration.h @@ -655,12 +655,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_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 7958082f79..3db4f425b3 100644 --- a/config/examples/RapideLite/RL200/Configuration.h +++ b/config/examples/RapideLite/RL200/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_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 8623675ce1..355c15e3ea 100644 --- a/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/config/examples/RapideLite/RL200/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Renkforce/RF100/Configuration.h b/config/examples/Renkforce/RF100/Configuration.h index 185149f505..df74efb1a0 100644 --- a/config/examples/Renkforce/RF100/Configuration.h +++ b/config/examples/Renkforce/RF100/Configuration.h @@ -662,12 +662,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Renkforce/RF100/Configuration_adv.h b/config/examples/Renkforce/RF100/Configuration_adv.h index b00e290a36..a9b596b86c 100644 --- a/config/examples/Renkforce/RF100/Configuration_adv.h +++ b/config/examples/Renkforce/RF100/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Renkforce/RF100XL/Configuration.h b/config/examples/Renkforce/RF100XL/Configuration.h index b849972372..e6b23a0ea5 100644 --- a/config/examples/Renkforce/RF100XL/Configuration.h +++ b/config/examples/Renkforce/RF100XL/Configuration.h @@ -662,12 +662,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Renkforce/RF100XL/Configuration_adv.h b/config/examples/Renkforce/RF100XL/Configuration_adv.h index b00e290a36..a9b596b86c 100644 --- a/config/examples/Renkforce/RF100XL/Configuration_adv.h +++ b/config/examples/Renkforce/RF100XL/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Renkforce/RF100v2/Configuration.h b/config/examples/Renkforce/RF100v2/Configuration.h index 59b15338c0..7cbbf47412 100644 --- a/config/examples/Renkforce/RF100v2/Configuration.h +++ b/config/examples/Renkforce/RF100v2/Configuration.h @@ -662,12 +662,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Renkforce/RF100v2/Configuration_adv.h b/config/examples/Renkforce/RF100v2/Configuration_adv.h index b00e290a36..a9b596b86c 100644 --- a/config/examples/Renkforce/RF100v2/Configuration_adv.h +++ b/config/examples/Renkforce/RF100v2/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 024ae5f687..e7e854d346 100644 --- a/config/examples/RepRapPro/Huxley/Configuration.h +++ b/config/examples/RepRapPro/Huxley/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 3e27c42088..ef3700d7b1 100644 --- a/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/config/examples/RepRapWorld/Megatronics/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 9fcd9f70fb..cc92071a97 100644 --- a/config/examples/RigidBot/Configuration.h +++ b/config/examples/RigidBot/Configuration.h @@ -650,12 +650,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 64e7a00b7c..0120be933b 100644 --- a/config/examples/RigidBot/Configuration_adv.h +++ b/config/examples/RigidBot/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/SCARA/MP_SCARA/Configuration.h b/config/examples/SCARA/MP_SCARA/Configuration.h index a8cee1a49e..fd9a647161 100644 --- a/config/examples/SCARA/MP_SCARA/Configuration.h +++ b/config/examples/SCARA/MP_SCARA/Configuration.h @@ -675,12 +675,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/MP_SCARA/Configuration_adv.h b/config/examples/SCARA/MP_SCARA/Configuration_adv.h index e5cc92b655..a838dfa55a 100644 --- a/config/examples/SCARA/MP_SCARA/Configuration_adv.h +++ b/config/examples/SCARA/MP_SCARA/Configuration_adv.h @@ -2077,12 +2077,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2090,114 +2090,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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_CHAIN_POS -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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_CHAIN_POS -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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_CHAIN_POS -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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_CHAIN_POS -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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_CHAIN_POS -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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_CHAIN_POS -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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_CHAIN_POS -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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_CHAIN_POS -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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_CHAIN_POS -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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_CHAIN_POS -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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_CHAIN_POS -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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_CHAIN_POS -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2223,7 +2242,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/SCARA/Morgan/Configuration.h b/config/examples/SCARA/Morgan/Configuration.h index e934c1c199..921661bd60 100644 --- a/config/examples/SCARA/Morgan/Configuration.h +++ b/config/examples/SCARA/Morgan/Configuration.h @@ -676,12 +676,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/Morgan/Configuration_adv.h b/config/examples/SCARA/Morgan/Configuration_adv.h index 91776cd91a..e5ca5c5cc9 100644 --- a/config/examples/SCARA/Morgan/Configuration_adv.h +++ b/config/examples/SCARA/Morgan/Configuration_adv.h @@ -2214,12 +2214,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2227,114 +2227,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2360,7 +2379,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/STM32/Black_STM32F407VET6/Configuration.h b/config/examples/STM32/Black_STM32F407VET6/Configuration.h index 6ad6f3510c..992cffd292 100644 --- a/config/examples/STM32/Black_STM32F407VET6/Configuration.h +++ b/config/examples/STM32/Black_STM32F407VET6/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h index cf60ac34b2..ec0282f288 100644 --- a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h +++ b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/STM32/STM32F103RE/Configuration.h b/config/examples/STM32/STM32F103RE/Configuration.h index 880cd22cf4..b0e6062a03 100644 --- a/config/examples/STM32/STM32F103RE/Configuration.h +++ b/config/examples/STM32/STM32F103RE/Configuration.h @@ -656,12 +656,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/STM32/STM32F4/Configuration.h b/config/examples/STM32/STM32F4/Configuration.h index 31320f2e6e..fd31a313b9 100644 --- a/config/examples/STM32/STM32F4/Configuration.h +++ b/config/examples/STM32/STM32F4/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 diff --git a/config/examples/STM32/stm32f103ret6/Configuration.h b/config/examples/STM32/stm32f103ret6/Configuration.h index 9e2da875c0..3a1a0332be 100644 --- a/config/examples/STM32/stm32f103ret6/Configuration.h +++ b/config/examples/STM32/stm32f103ret6/Configuration.h @@ -656,12 +656,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 d134dd63e6..e8f5718269 100644 --- a/config/examples/Sanguinololu/Configuration.h +++ b/config/examples/Sanguinololu/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 65d8d7b35f..66a1f3b66b 100644 --- a/config/examples/Sanguinololu/Configuration_adv.h +++ b/config/examples/Sanguinololu/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Tevo/Michelangelo/Configuration.h b/config/examples/Tevo/Michelangelo/Configuration.h index 2821b2b8a7..edbe1789b4 100644 --- a/config/examples/Tevo/Michelangelo/Configuration.h +++ b/config/examples/Tevo/Michelangelo/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Tevo/Michelangelo/Configuration_adv.h b/config/examples/Tevo/Michelangelo/Configuration_adv.h index bbb5a66085..ce6255c14d 100644 --- a/config/examples/Tevo/Michelangelo/Configuration_adv.h +++ b/config/examples/Tevo/Michelangelo/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Tevo/Nereus/Configuration.h b/config/examples/Tevo/Nereus/Configuration.h index e7b0190e13..a2f47ed972 100755 --- a/config/examples/Tevo/Nereus/Configuration.h +++ b/config/examples/Tevo/Nereus/Configuration.h @@ -644,12 +644,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Tevo/Nereus/Configuration_adv.h b/config/examples/Tevo/Nereus/Configuration_adv.h index 0141758c99..d9676927e9 100755 --- a/config/examples/Tevo/Nereus/Configuration_adv.h +++ b/config/examples/Tevo/Nereus/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Tevo/Tarantula Pro/Configuration.h b/config/examples/Tevo/Tarantula Pro/Configuration.h index cb585328ec..ead2efd016 100644 --- a/config/examples/Tevo/Tarantula Pro/Configuration.h +++ b/config/examples/Tevo/Tarantula Pro/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h index 5583327ab8..2a0f14c796 100755 --- a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h +++ b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h index dc30a449a1..a50339f9c7 100644 --- a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h +++ b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h index 405d5dfaef..268d5012b1 100755 --- a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h +++ b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h index b0ff96fb5a..06a29799be 100644 --- a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h +++ b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h index 405d5dfaef..268d5012b1 100755 --- a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h +++ b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 2e6d7c0ae6..a4fed7cdf8 100644 --- a/config/examples/TheBorg/Configuration.h +++ b/config/examples/TheBorg/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 78b1487efd..a1605c8853 100644 --- a/config/examples/TheBorg/Configuration_adv.h +++ b/config/examples/TheBorg/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 f929dad27e..5daff15e71 100644 --- a/config/examples/TinyBoy2/Configuration.h +++ b/config/examples/TinyBoy2/Configuration.h @@ -705,12 +705,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 65bef41c71..557d065509 100644 --- a/config/examples/TinyBoy2/Configuration_adv.h +++ b/config/examples/TinyBoy2/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 1c19c57741..9cf5e5f9e0 100644 --- a/config/examples/Tronxy/X1/Configuration.h +++ b/config/examples/Tronxy/X1/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 a1925ed92d..6e8d6ba63c 100644 --- a/config/examples/Tronxy/X3A/Configuration.h +++ b/config/examples/Tronxy/X3A/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 716359af4a..e6ef5ba827 100644 --- a/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/config/examples/Tronxy/X3A/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 3798702622..aacbf86de3 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration.h +++ b/config/examples/Tronxy/X5S-2E/Configuration.h @@ -673,15 +673,16 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_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. +// The OEM stock model uses HEROIC HR4982MTE982 drivers, similar to A4988 but with 2 step jumpers instead of 3. //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 //#define Z_DRIVER_TYPE A4988 diff --git a/config/examples/Tronxy/X5S-2E/Configuration_adv.h b/config/examples/Tronxy/X5S-2E/Configuration_adv.h index f1b7a5b190..7b6c991fe4 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 f9ea708eec..d653211b51 100644 --- a/config/examples/Tronxy/X5S/Configuration.h +++ b/config/examples/Tronxy/X5S/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 6439b70c7f..1f5d3b17cf 100644 --- a/config/examples/Tronxy/XY100/Configuration.h +++ b/config/examples/Tronxy/XY100/Configuration.h @@ -665,12 +665,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 923514ac0b..6639d639ee 100644 --- a/config/examples/UltiMachine/Archim1/Configuration.h +++ b/config/examples/UltiMachine/Archim1/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_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 de98363862..8fcc910ab9 100644 --- a/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 677e416cbe..47aba4e3cd 100644 --- a/config/examples/UltiMachine/Archim2/Configuration.h +++ b/config/examples/UltiMachine/Archim2/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_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 59dee70aeb..fd8eba2ea6 100644 --- a/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 d88a72de45..20435576e5 100644 --- a/config/examples/VORONDesign/Configuration.h +++ b/config/examples/VORONDesign/Configuration.h @@ -663,12 +663,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_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 ab1f68b5fa..a3da1f2666 100644 --- a/config/examples/VORONDesign/Configuration_adv.h +++ b/config/examples/VORONDesign/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 8005ab08f1..d4d28007fb 100644 --- a/config/examples/Velleman/K8200/Configuration.h +++ b/config/examples/Velleman/K8200/Configuration.h @@ -684,12 +684,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 4ad5a55278..f2aa2c54e4 100644 --- a/config/examples/Velleman/K8200/Configuration_adv.h +++ b/config/examples/Velleman/K8200/Configuration_adv.h @@ -2230,12 +2230,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2243,114 +2243,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2376,7 +2395,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 1f65ea525c..bcddd93063 100644 --- a/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/config/examples/Velleman/K8400/Dual-head/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/Dual-head/Configuration_adv.h b/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h index f5d9601b17..eb408012cf 100644 --- a/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Velleman/K8400/Single-head/Configuration.h b/config/examples/Velleman/K8400/Single-head/Configuration.h index bc293677e0..6c86f1706e 100644 --- a/config/examples/Velleman/K8400/Single-head/Configuration.h +++ b/config/examples/Velleman/K8400/Single-head/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/Single-head/Configuration_adv.h b/config/examples/Velleman/K8400/Single-head/Configuration_adv.h index f5d9601b17..eb408012cf 100644 --- a/config/examples/Velleman/K8400/Single-head/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Single-head/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/WASP/PowerWASP/Configuration.h b/config/examples/WASP/PowerWASP/Configuration.h index 6539f7339b..b8dd81e9e4 100644 --- a/config/examples/WASP/PowerWASP/Configuration.h +++ b/config/examples/WASP/PowerWASP/Configuration.h @@ -673,12 +673,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 816a916ab6..05c06d90b0 100644 --- a/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 1c0b4b0516..98da8c696d 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration.h @@ -664,12 +664,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 2ac7886887..5d25dcefbb 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Wanhao/Duplicator i3 2.1/Configuration.h b/config/examples/Wanhao/Duplicator i3 2.1/Configuration.h index 9e439408b4..f8e2b9e5e8 100644 --- a/config/examples/Wanhao/Duplicator i3 2.1/Configuration.h +++ b/config/examples/Wanhao/Duplicator i3 2.1/Configuration.h @@ -665,12 +665,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 i3 2.1/Configuration_adv.h b/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h index 6509c4dd8d..a5a044b218 100644 --- a/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h b/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h index ff0da296fe..923fb0183a 100755 --- a/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h +++ b/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 i3 Mini/Configuration_adv.h b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h index 95998b65a6..a0eed6fa79 100644 --- a/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 ea7b979aa6..1fbbfd280b 100644 --- a/config/examples/adafruit/ST7565/Configuration.h +++ b/config/examples/adafruit/ST7565/Configuration.h @@ -654,12 +654,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 bcd9394327..c2c9db5ab4 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration.h @@ -773,12 +773,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 5b195f97c8..960a997180 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/Dreammaker/Overlord/Configuration.h b/config/examples/delta/Dreammaker/Overlord/Configuration.h index 9acc2edd1b..232607a57a 100644 --- a/config/examples/delta/Dreammaker/Overlord/Configuration.h +++ b/config/examples/delta/Dreammaker/Overlord/Configuration.h @@ -725,12 +725,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_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/delta/Dreammaker/Overlord/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h index 67d3329f17..5b05f9712b 100644 --- a/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h +++ b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h @@ -2218,12 +2218,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2231,114 +2231,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2364,7 +2383,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h index 3929fee026..99fbf03c36 100644 --- a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h +++ b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h @@ -737,12 +737,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_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/delta/Dreammaker/Overlord_Pro/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h index c722aa1205..522ba59457 100644 --- a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h +++ b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/FLSUN/QQ-S/Configuration.h b/config/examples/delta/FLSUN/QQ-S/Configuration.h index b950945faf..bb25c630e4 100644 --- a/config/examples/delta/FLSUN/QQ-S/Configuration.h +++ b/config/examples/delta/FLSUN/QQ-S/Configuration.h @@ -725,12 +725,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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/QQ-S/Configuration_adv.h b/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h index c18a2dead4..d1e827aa51 100644 --- a/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h +++ b/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 2dbefaed55..ae462aec91 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -725,12 +725,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 a15e7fe20b..128e91e336 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 7b06e4a454..abf07aa232 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/config/examples/delta/FLSUN/kossel/Configuration.h @@ -725,12 +725,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 a15e7fe20b..128e91e336 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 8a35d493d4..972f11b4cf 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -725,12 +725,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 d05a1d531d..a3379353fc 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/Geeetech/G2Pro/Configuration_adv.h b/config/examples/delta/Geeetech/G2Pro/Configuration_adv.h index 36564fd1df..9ca82f7dea 100644 --- a/config/examples/delta/Geeetech/G2Pro/Configuration_adv.h +++ b/config/examples/delta/Geeetech/G2Pro/Configuration_adv.h @@ -2222,9 +2222,9 @@ // @section L6470 /** - * 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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,129 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #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) + // On L6474 STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_CHAIN_POS 0 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_CHAIN_POS 0 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_CHAIN_POS 0 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_CHAIN_POS 0 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_CHAIN_POS 0 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_CHAIN_POS 0 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_CHAIN_POS 0 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_CHAIN_POS 0 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_CHAIN_POS 0 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_CHAIN_POS 0 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_CHAIN_POS 0 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_CHAIN_POS 0 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2380,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 e78f342035..e5a964a3e6 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration.h @@ -715,12 +715,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 2b85f97fe2..d5191cd00e 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 735d5c0f26..42dc766562 100644 --- a/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -730,12 +730,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 ef29955145..c8d18a252e 100644 --- a/config/examples/delta/MKS/SBASE/Configuration.h +++ b/config/examples/delta/MKS/SBASE/Configuration.h @@ -715,12 +715,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 c131b42397..59eaa019f4 100644 --- a/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 51549e662e..0c23b667df 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration.h +++ b/config/examples/delta/Tevo Little Monster/Configuration.h @@ -719,12 +719,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ //#define X_DRIVER_TYPE A4988 //#define Y_DRIVER_TYPE A4988 @@ -888,7 +889,7 @@ * * Enable this option for a probe connected to the Z Min endstop pin. */ -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN /** * Z_MIN_PROBE_PIN diff --git a/config/examples/delta/Tevo Little Monster/Configuration_adv.h b/config/examples/delta/Tevo Little Monster/Configuration_adv.h index 39744d8a48..d124a28c4e 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -399,7 +399,7 @@ * Multiple extruders can be assigned to the same pin in which case * the fan will turn on when any selected extruder is above the threshold. */ -#define E0_AUTO_FAN_PIN MOSFET_D_PIN +#define E0_AUTO_FAN_PIN HEATER_1_PIN #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 8396e3cab5..ebcefd9da9 100644 --- a/config/examples/delta/generic/Configuration.h +++ b/config/examples/delta/generic/Configuration.h @@ -715,12 +715,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 d05a1d531d..a3379353fc 100644 --- a/config/examples/delta/generic/Configuration_adv.h +++ b/config/examples/delta/generic/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/delta/kossel_clear/Configuration.h b/config/examples/delta/kossel_clear/Configuration.h index 7bcca3ea38..bdcbaf1526 100644 --- a/config/examples/delta/kossel_clear/Configuration.h +++ b/config/examples/delta/kossel_clear/Configuration.h @@ -726,12 +726,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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_clear/Configuration_adv.h b/config/examples/delta/kossel_clear/Configuration_adv.h index 148e70fc93..f62cb2a711 100644 --- a/config/examples/delta/kossel_clear/Configuration_adv.h +++ b/config/examples/delta/kossel_clear/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 d2eb7c7557..805ed4f26c 100644 --- a/config/examples/delta/kossel_mini/Configuration.h +++ b/config/examples/delta/kossel_mini/Configuration.h @@ -715,12 +715,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 d05a1d531d..a3379353fc 100644 --- a/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/kossel_mini/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 4acda41070..0c8f9f0ddf 100644 --- a/config/examples/delta/kossel_pro/Configuration.h +++ b/config/examples/delta/kossel_pro/Configuration.h @@ -701,12 +701,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 6cc099abe5..5735b60c02 100644 --- a/config/examples/delta/kossel_xl/Configuration.h +++ b/config/examples/delta/kossel_xl/Configuration.h @@ -719,12 +719,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 994cb688bd..645994e4ae 100644 --- a/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/config/examples/delta/kossel_xl/Configuration_adv.h @@ -2219,12 +2219,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2232,114 +2232,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2365,7 +2384,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 7291180cf0..5d9043be90 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/config/examples/gCreate/gMax1.5+/Configuration.h @@ -667,12 +667,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 1c56122fd1..9710641199 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 c96b1b8038..44d4b7dcb8 100644 --- a/config/examples/makibox/Configuration.h +++ b/config/examples/makibox/Configuration.h @@ -657,12 +657,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 7bd096bbc0..18c89f83ca 100644 --- a/config/examples/makibox/Configuration_adv.h +++ b/config/examples/makibox/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/config/examples/tvrrug/Round2/Configuration.h b/config/examples/tvrrug/Round2/Configuration.h index 61fea86992..410be4223b 100644 --- a/config/examples/tvrrug/Round2/Configuration.h +++ b/config/examples/tvrrug/Round2/Configuration.h @@ -643,12 +643,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 3aaeb97421..139283f472 100644 --- a/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/config/examples/tvrrug/Round2/Configuration_adv.h @@ -2217,12 +2217,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2230,114 +2230,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2363,7 +2382,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 214dce6ddf..09cfa27b34 100644 --- a/config/examples/wt150/Configuration.h +++ b/config/examples/wt150/Configuration.h @@ -659,12 +659,13 @@ * * A4988 is assumed for unspecified drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', '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 c149f1ba51..8a1a7e783d 100644 --- a/config/examples/wt150/Configuration_adv.h +++ b/config/examples/wt150/Configuration_adv.h @@ -2218,12 +2218,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.8.0 or higher) is required. * https://github.com/ameyer/Arduino-L6470 * * Requires the following to be defined in your pins_YOUR_BOARD file @@ -2231,114 +2231,133 @@ * L6470_CHAIN_MISO_PIN * L6470_CHAIN_MOSI_PIN * L6470_CHAIN_SS_PIN - * L6470_RESET_CHAIN_PIN (optional) + * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset */ -#if HAS_DRIVER(L6470) + +#if HAS_L64XX //#define L6470_CHITCHAT // Display additional status info - #if AXIS_DRIVER_TYPE_X(L6470) - #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 -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #if AXIS_IS_L64XX(X) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current + // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down + // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down + // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down + // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 + #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest #endif - #if AXIS_DRIVER_TYPE_X2(L6470) + #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 -1 + #define X2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y(L6470) + #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 -1 + #define Y_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) + #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 -1 + #define Y2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z(L6470) + #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 -1 + #define Z_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) + #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 -1 + #define Z2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) + #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 -1 + #define Z3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E0(L6470) + #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 -1 + #define E0_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E1(L6470) + #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 -1 + #define E1_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E2(L6470) + #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 -1 + #define E2_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E3(L6470) + #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 -1 + #define E3_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E4(L6470) + #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 -1 + #define E4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_E5(L6470) + #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 -1 + #define E5_SLEW_RATE 1 #endif /** @@ -2364,7 +2383,7 @@ //#define L6470_STOP_ON_ERROR #endif -#endif // L6470 +#endif // HAS_L64XX /** * TWI/I2C BUS diff --git a/platformio.ini b/platformio.ini index 141468c435..cc50614730 100644 --- a/platformio.ini +++ b/platformio.ini @@ -31,7 +31,7 @@ lib_deps = U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip Adafruit_MAX31865=https://github.com/adafruit/Adafruit_MAX31865/archive/master.zip LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip - Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/dev.zip + Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/0.8.0.zip SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip SailfishRGB_LED=https://github.com/mikeshub/SailfishRGB_LED/archive/master.zip SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip