[1.1.x] TMC driver update (#8712)

This commit is contained in:
teemuatlut 2017-12-15 23:02:39 +02:00 committed by Scott Lahteine
parent f38f2ace5a
commit 0ac0324af2
43 changed files with 3588 additions and 1641 deletions

View file

@ -52,6 +52,10 @@ install:
- git clone https://github.com/teemuatlut/TMC2130Stepper.git
- sudo mv TMC2130Stepper /usr/local/share/arduino/libraries/TMC2130Stepper
#
# Install: TMC2208 Stepper Motor Controller library
- git clone https://github.com/teemuatlut/TMC2208Stepper.git
- sudo mv TMC2208Stepper /usr/local/share/arduino/libraries/TMC2208Stepper
#
# Install: Adafruit Neopixel library
- git clone https://github.com/adafruit/Adafruit_NeoPixel.git
- sudo mv Adafruit_NeoPixel /usr/local/share/arduino/libraries/Adafruit_NeoPixel
@ -345,7 +349,14 @@ script:
- use_example_configs SCARA
- opt_enable AUTO_BED_LEVELING_BILINEAR FIX_MOUNTED_PROBE USE_ZMIN_PLUG EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER
- opt_enable_adv HAVE_TMC2130 X_IS_TMC2130 Y_IS_TMC2130 Z_IS_TMC2130
- opt_enable_adv AUTOMATIC_CURRENT_CONTROL STEALTHCHOP HYBRID_THRESHOLD SENSORLESS_HOMING
- opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG SENSORLESS_HOMING
- build_marlin
#
# TMC2208 Config
#
- restore_configs
- opt_enable_adv HAVE_TMC2208 X_IS_TMC2208 Y_IS_TMC2208 Z_IS_TMC2208
- opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG
- build_marlin
#
# tvrrug Config need to check board type for sanguino atmega644p

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -29,6 +29,7 @@
#include "Version.h"
#include "Configuration.h"
#include "Conditionals_LCD.h"
#include "tmc_macros.h"
#include "Configuration_adv.h"
#include "pins.h"
#ifndef USBCON

File diff suppressed because it is too large Load diff

View file

@ -1404,23 +1404,45 @@ static_assert(1 >= 0
/**
* Make sure HAVE_TMC2130 is warranted
*/
#if ENABLED(HAVE_TMC2130)
#if !( ENABLED( X_IS_TMC2130 ) \
|| ENABLED( X2_IS_TMC2130 ) \
|| ENABLED( Y_IS_TMC2130 ) \
|| ENABLED( Y2_IS_TMC2130 ) \
|| ENABLED( Z_IS_TMC2130 ) \
|| ENABLED( Z2_IS_TMC2130 ) \
|| ENABLED( E0_IS_TMC2130 ) \
|| ENABLED( E1_IS_TMC2130 ) \
|| ENABLED( E2_IS_TMC2130 ) \
|| ENABLED( E3_IS_TMC2130 ) \
|| ENABLED( E4_IS_TMC2130 ) \
)
#error "HAVE_TMC2130 requires at least one TMC2130 stepper to be set."
#elif ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
#error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
#endif
#if ENABLED(HAVE_TMC2130) && !( \
ENABLED( X_IS_TMC2130 ) \
|| ENABLED( X2_IS_TMC2130 ) \
|| ENABLED( Y_IS_TMC2130 ) \
|| ENABLED( Y2_IS_TMC2130 ) \
|| ENABLED( Z_IS_TMC2130 ) \
|| ENABLED( Z2_IS_TMC2130 ) \
|| ENABLED( E0_IS_TMC2130 ) \
|| ENABLED( E1_IS_TMC2130 ) \
|| ENABLED( E2_IS_TMC2130 ) \
|| ENABLED( E3_IS_TMC2130 ) \
|| ENABLED( E4_IS_TMC2130 ) )
#error "HAVE_TMC2130 requires at least one TMC2130 stepper to be set."
#elif ENABLED(SENSORLESS_HOMING) && DISABLED(HAVE_TMC2130)
#error "Enable HAVE_TMC2130 to use SENSORLESS_HOMING."
#elif defined(AUTOMATIC_CURRENT_CONTROL)
#error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
#endif
/**
* Make sure HAVE_TMC2208 is warranted
*/
#if ENABLED(HAVE_TMC2208) && !( \
ENABLED( X_IS_TMC2208 ) \
|| ENABLED( X2_IS_TMC2208 ) \
|| ENABLED( Y_IS_TMC2208 ) \
|| ENABLED( Y2_IS_TMC2208 ) \
|| ENABLED( Z_IS_TMC2208 ) \
|| ENABLED( Z2_IS_TMC2208 ) \
|| ENABLED( E0_IS_TMC2208 ) \
|| ENABLED( E1_IS_TMC2208 ) \
|| ENABLED( E2_IS_TMC2208 ) \
|| ENABLED( E3_IS_TMC2208 ) )
#error "HAVE_TMC2208 requires at least one TMC2208 stepper to be set."
#endif
#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
#error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
#endif
/**

View file

@ -36,13 +36,13 @@
*
*/
#define EEPROM_VERSION "V46"
#define EEPROM_VERSION "V47"
// Change EEPROM version if these are changed:
#define EEPROM_OFFSET 100
/**
* V46 EEPROM Layout:
* V47 EEPROM Layout:
*
* 100 Version (char x4)
* 104 EEPROM CRC16 (uint16_t)
@ -141,7 +141,7 @@
* 539 M200 D parser.volumetric_enabled (bool)
* 540 M200 T D planner.filament_size (float x5) (T0..3)
*
* HAVE_TMC2130: 22 bytes
* HAVE_TMC2130 || HAVE_TMC2208: 22 bytes
* 560 M906 X Stepper X current (uint16_t)
* 562 M906 Y Stepper Y current (uint16_t)
* 564 M906 Z Stepper Z current (uint16_t)
@ -154,25 +154,29 @@
* 578 M906 E3 Stepper E3 current (uint16_t)
* 580 M906 E4 Stepper E4 current (uint16_t)
*
* SENSORLESS HOMING 4 bytes
* 582 M914 X Stepper X and X2 threshold (int16_t)
* 584 M914 Y Stepper Y and Y2 threshold (int16_t)
*
* LIN_ADVANCE: 8 bytes
* 582 M900 K extruder_advance_k (float)
* 586 M900 WHD advance_ed_ratio (float)
* 586 M900 K extruder_advance_k (float)
* 590 M900 WHD advance_ed_ratio (float)
*
* HAS_MOTOR_CURRENT_PWM:
* 590 M907 X Stepper XY current (uint32_t)
* 594 M907 Z Stepper Z current (uint32_t)
* 598 M907 E Stepper E current (uint32_t)
* 594 M907 X Stepper XY current (uint32_t)
* 598 M907 Z Stepper Z current (uint32_t)
* 602 M907 E Stepper E current (uint32_t)
*
* CNC_COORDINATE_SYSTEMS 108 bytes
* 602 G54-G59.3 coordinate_system (float x 27)
* 606 G54-G59.3 coordinate_system (float x 27)
*
* SKEW_CORRECTION: 12 bytes
* 710 M852 I planner.xy_skew_factor (float)
* 714 M852 J planner.xz_skew_factor (float)
* 718 M852 K planner.yz_skew_factor (float)
* 714 M852 I planner.xy_skew_factor (float)
* 718 M852 J planner.xz_skew_factor (float)
* 722 M852 K planner.yz_skew_factor (float)
*
* 722 Minimum end-point
* 2251 (722 + 208 + 36 + 9 + 288 + 988) Maximum end-point
* 726 Minimum end-point
* 2255 (726 + 208 + 36 + 9 + 288 + 988) Maximum end-point
*
* ========================================================================
* meshes_begin (between max and min end-point, directly above)
@ -199,7 +203,7 @@ MarlinSettings settings;
#include "mesh_bed_leveling.h"
#endif
#if ENABLED(HAVE_TMC2130)
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
#include "stepper_indirection.h"
#endif
@ -570,70 +574,70 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(dummy);
}
// Save TMC2130 Configuration, and placeholder values
// Save TMC2130 or TMC2208 Configuration, and placeholder values
uint16_t val;
#if ENABLED(HAVE_TMC2130)
#if ENABLED(X_IS_TMC2130)
#if HAS_TRINAMIC
#if X_IS_TRINAMIC
val = stepperX.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(Y_IS_TMC2130)
#if Y_IS_TRINAMIC
val = stepperY.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(Z_IS_TMC2130)
#if Z_IS_TRINAMIC
val = stepperZ.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(X2_IS_TMC2130)
#if X2_IS_TRINAMIC
val = stepperX2.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(Y2_IS_TMC2130)
#if Y2_IS_TRINAMIC
val = stepperY2.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(Z2_IS_TMC2130)
#if Z2_IS_TRINAMIC
val = stepperZ2.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(E0_IS_TMC2130)
#if E0_IS_TRINAMIC
val = stepperE0.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(E1_IS_TMC2130)
#if E1_IS_TRINAMIC
val = stepperE1.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(E2_IS_TMC2130)
#if E2_IS_TRINAMIC
val = stepperE2.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(E3_IS_TMC2130)
#if E3_IS_TRINAMIC
val = stepperE3.getCurrent();
#else
val = 0;
#endif
EEPROM_WRITE(val);
#if ENABLED(E4_IS_TMC2130)
#if E4_IS_TRINAMIC
val = stepperE4.getCurrent();
#else
val = 0;
@ -644,6 +648,28 @@ void MarlinSettings::postprocess() {
for (uint8_t q = 11; q--;) EEPROM_WRITE(val);
#endif
//
// TMC2130 Sensorless homing threshold
//
int16_t thrs;
#if ENABLED(SENSORLESS_HOMING)
#if ENABLED(X_IS_TMC2130)
thrs = stepperX.sgt();
#else
thrs = 0;
#endif
EEPROM_WRITE(thrs);
#if ENABLED(Y_IS_TMC2130)
thrs = stepperY.sgt();
#else
thrs = 0;
#endif
EEPROM_WRITE(thrs);
#else
thrs = 0;
for (uint8_t q = 2; q--;) EEPROM_WRITE(thrs);
#endif
//
// Linear Advance
//
@ -1039,55 +1065,80 @@ void MarlinSettings::postprocess() {
//
uint16_t val;
#if ENABLED(HAVE_TMC2130)
#if HAS_TRINAMIC
EEPROM_READ(val);
#if ENABLED(X_IS_TMC2130)
#if X_IS_TRINAMIC
stepperX.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(Y_IS_TMC2130)
#if Y_IS_TRINAMIC
stepperY.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(Z_IS_TMC2130)
#if Z_IS_TRINAMIC
stepperZ.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(X2_IS_TMC2130)
#if X2_IS_TRINAMIC
stepperX2.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(Y2_IS_TMC2130)
#if Y2_IS_TRINAMIC
stepperY2.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(Z2_IS_TMC2130)
#if Z2_IS_TRINAMIC
stepperZ2.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(E0_IS_TMC2130)
#if E0_IS_TRINAMIC
stepperE0.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(E1_IS_TMC2130)
#if E1_IS_TRINAMIC
stepperE1.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(E2_IS_TMC2130)
#if E2_IS_TRINAMIC
stepperE2.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(E3_IS_TMC2130)
#if E3_IS_TRINAMIC
stepperE3.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
EEPROM_READ(val);
#if ENABLED(E4_IS_TMC2130)
#if E4_IS_TRINAMIC
stepperE4.setCurrent(val, R_SENSE, HOLD_MULTIPLIER);
#endif
#else
for (uint8_t q = 11; q--;) EEPROM_READ(val);
#endif
/*
* TMC2130 Sensorless homing threshold.
* X and X2 use the same value
* Y and Y2 use the same value
*/
int16_t thrs;
#if ENABLED(SENSORLESS_HOMING)
EEPROM_READ(thrs);
#if ENABLED(X_IS_TMC2130)
stepperX.sgt(thrs);
#endif
#if ENABLED(X2_IS_TMC2130)
stepperX2.sgt(thrs);
#endif
EEPROM_READ(thrs);
#if ENABLED(Y_IS_TMC2130)
stepperY.sgt(thrs);
#endif
#if ENABLED(Y2_IS_TMC2130)
stepperY2.sgt(thrs);
#endif
#else
for (uint8_t q = 0; q < 2; q++) EEPROM_READ(thrs);
#endif
//
// Linear Advance
//
@ -1469,36 +1520,52 @@ void MarlinSettings::reset() {
#endif
);
#if ENABLED(HAVE_TMC2130)
#if X_IS_TRINAMIC
stepperX.setCurrent(X_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if Y_IS_TRINAMIC
stepperY.setCurrent(Y_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if Z_IS_TRINAMIC
stepperZ.setCurrent(Z_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if X2_IS_TRINAMIC
stepperX2.setCurrent(X2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if Y2_IS_TRINAMIC
stepperY2.setCurrent(Y2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if Z2_IS_TRINAMIC
stepperZ2.setCurrent(Z2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if E0_IS_TRINAMIC
stepperE0.setCurrent(E0_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if E1_IS_TRINAMIC
stepperE1.setCurrent(E1_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if E2_IS_TRINAMIC
stepperE2.setCurrent(E2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if E3_IS_TRINAMIC
stepperE3.setCurrent(E3_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if E4_IS_TRINAMIC
stepperE4.setCurrent(E4_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if ENABLED(SENSORLESS_HOMING)
#if ENABLED(X_IS_TMC2130)
stepperX.setCurrent(X_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if ENABLED(Y_IS_TMC2130)
stepperY.setCurrent(Y_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if ENABLED(Z_IS_TMC2130)
stepperZ.setCurrent(Z_CURRENT, R_SENSE, HOLD_MULTIPLIER);
stepperX.sgt(X_HOMING_SENSITIVITY);
#endif
#if ENABLED(X2_IS_TMC2130)
stepperX2.setCurrent(X2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
stepperX2.sgt(X_HOMING_SENSITIVITY);
#endif
#if ENABLED(Y_IS_TMC2130)
stepperY.sgt(Y_HOMING_SENSITIVITY);
#endif
#if ENABLED(Y2_IS_TMC2130)
stepperY2.setCurrent(Y2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if ENABLED(Z2_IS_TMC2130)
stepperZ2.setCurrent(Z2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if ENABLED(E0_IS_TMC2130)
stepperE0.setCurrent(E0_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if ENABLED(E1_IS_TMC2130)
stepperE1.setCurrent(E1_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if ENABLED(E2_IS_TMC2130)
stepperE2.setCurrent(E2_CURRENT, R_SENSE, HOLD_MULTIPLIER);
#endif
#if ENABLED(E3_IS_TMC2130)
stepperE3.setCurrent(E3_CURRENT, R_SENSE, HOLD_MULTIPLIER);
stepperY2.sgt(Y_HOMING_SENSITIVITY);
#endif
#endif
@ -1982,35 +2049,63 @@ void MarlinSettings::reset() {
}
CONFIG_ECHO_START;
SERIAL_ECHO(" M906");
#if ENABLED(X_IS_TMC2130) || ENABLED(X_IS_TMC2208)
SERIAL_ECHOPAIR(" X ", stepperX.getCurrent());
#endif
#if ENABLED(Y_IS_TMC2130) || ENABLED(Y_IS_TMC2208)
SERIAL_ECHOPAIR(" Y ", stepperY.getCurrent());
#endif
#if ENABLED(Z_IS_TMC2130) || ENABLED(Z_IS_TMC2208)
SERIAL_ECHOPAIR(" Z ", stepperZ.getCurrent());
#endif
#if ENABLED(X2_IS_TMC2130) || ENABLED(X2_IS_TMC2208)
SERIAL_ECHOPAIR(" X2 ", stepperX2.getCurrent());
#endif
#if ENABLED(Y2_IS_TMC2130) || ENABLED(Y2_IS_TMC2208)
SERIAL_ECHOPAIR(" Y2 ", stepperY2.getCurrent());
#endif
#if ENABLED(Z2_IS_TMC2130) || ENABLED(Z2_IS_TMC2208)
SERIAL_ECHOPAIR(" Z2 ", stepperZ2.getCurrent());
#endif
#if ENABLED(E0_IS_TMC2130) || ENABLED(E0_IS_TMC2208)
SERIAL_ECHOPAIR(" E0 ", stepperE0.getCurrent());
#endif
#if ENABLED(E1_IS_TMC2130) || ENABLED(E1_IS_TMC2208)
SERIAL_ECHOPAIR(" E1 ", stepperE1.getCurrent());
#endif
#if ENABLED(E2_IS_TMC2130) || ENABLED(E2_IS_TMC2208)
SERIAL_ECHOPAIR(" E2 ", stepperE2.getCurrent());
#endif
#if ENABLED(E3_IS_TMC2130) || ENABLED(E3_IS_TMC2208)
SERIAL_ECHOPAIR(" E3 ", stepperE3.getCurrent());
#endif
#if ENABLED(E4_IS_TMC2130) || ENABLED(E4_IS_TMC2208)
SERIAL_ECHOPAIR(" E4 ", stepperE4.getCurrent());
#endif
SERIAL_EOL();
#endif
/**
* TMC2130 Sensorless homing thresholds
*/
#if ENABLED(HAVE_TMC2130) && ENABLED(SENSORLESS_HOMING)
if (!forReplay) {
CONFIG_ECHO_START;
SERIAL_ECHOLNPGM("Sensorless homing threshold:");
}
CONFIG_ECHO_START;
SERIAL_ECHO(" M914");
#if ENABLED(X_IS_TMC2130)
SERIAL_ECHOPAIR(" X", stepperX.getCurrent());
#endif
#if ENABLED(Y_IS_TMC2130)
SERIAL_ECHOPAIR(" Y", stepperY.getCurrent());
#endif
#if ENABLED(Z_IS_TMC2130)
SERIAL_ECHOPAIR(" Z", stepperZ.getCurrent());
SERIAL_ECHOPAIR(" X", stepperX.sgt());
#endif
#if ENABLED(X2_IS_TMC2130)
SERIAL_ECHOPAIR(" X2", stepperX2.getCurrent());
SERIAL_ECHOPAIR(" X2 ", stepperX2.sgt());
#endif
#if ENABLED(Y2_IS_TMC2130)
SERIAL_ECHOPAIR(" Y2", stepperY2.getCurrent());
#if ENABLED(Y_IS_TMC2130)
SERIAL_ECHOPAIR(" Y", stepperY.sgt());
#endif
#if ENABLED(Z2_IS_TMC2130)
SERIAL_ECHOPAIR(" Z2", stepperZ2.getCurrent());
#endif
#if ENABLED(E0_IS_TMC2130)
SERIAL_ECHOPAIR(" E0", stepperE0.getCurrent());
#endif
#if ENABLED(E1_IS_TMC2130)
SERIAL_ECHOPAIR(" E1", stepperE1.getCurrent());
#endif
#if ENABLED(E2_IS_TMC2130)
SERIAL_ECHOPAIR(" E2", stepperE2.getCurrent());
#endif
#if ENABLED(E3_IS_TMC2130)
SERIAL_ECHOPAIR(" E3", stepperE3.getCurrent());
#if ENABLED(X2_IS_TMC2130)
SERIAL_ECHOPAIR(" Y2 ", stepperY2.sgt());
#endif
SERIAL_EOL();
#endif

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -977,7 +977,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -991,7 +991,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1006,46 +1018,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1054,24 +1078,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1086,8 +1108,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1097,7 +1119,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1106,27 +1128,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -943,7 +943,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -957,7 +957,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -972,46 +984,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1020,24 +1044,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1052,8 +1074,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1063,7 +1085,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1072,27 +1094,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -987,7 +987,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -1001,7 +1001,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1016,46 +1028,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1064,24 +1088,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1096,8 +1118,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1107,7 +1129,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1116,27 +1138,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -978,7 +978,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -992,7 +992,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1007,46 +1019,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1055,24 +1079,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1087,8 +1109,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1098,7 +1120,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1107,27 +1129,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -978,7 +978,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -992,7 +992,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1007,46 +1019,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1055,24 +1079,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1087,8 +1109,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1098,7 +1120,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1107,27 +1129,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -978,7 +978,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -992,7 +992,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1007,46 +1019,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1055,24 +1079,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1087,8 +1109,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1098,7 +1120,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1107,27 +1129,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -978,7 +978,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -992,7 +992,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1007,46 +1019,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1055,24 +1079,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1087,8 +1109,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1098,7 +1120,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1107,27 +1129,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -978,7 +978,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -992,7 +992,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1007,46 +1019,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1055,24 +1079,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1087,8 +1109,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1098,7 +1120,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1107,27 +1129,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -983,7 +983,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -997,7 +997,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1012,46 +1024,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1060,24 +1084,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1092,8 +1114,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1103,7 +1125,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1112,27 +1134,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -978,7 +978,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -992,7 +992,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1007,46 +1019,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1055,24 +1079,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1087,8 +1109,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1098,7 +1120,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1107,27 +1129,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -976,7 +976,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -990,7 +990,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -1005,46 +1017,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1053,24 +1077,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1085,8 +1107,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1096,7 +1118,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1105,27 +1127,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -966,7 +966,7 @@
#endif
// @section TMC2130
// @section TMC2130, TMC2208
/**
* Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
@ -980,7 +980,19 @@
*/
//#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130)
/**
* Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
* Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin.
* To use the reading capabilities, also connect #_SERIAL_RX_PIN
* to #_SERIAL_TX_PIN with a 1K resistor.
* The drivers can also be used with hardware serial.
*
* You'll also need the TMC2208Stepper Arduino library
* (https://github.com/teemuatlut/TMC2208Stepper).
*/
//#define HAVE_TMC2208
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
// CHOOSE YOUR MOTORS HERE, THIS IS MANDATORY
//#define X_IS_TMC2130
@ -995,46 +1007,58 @@
//#define E3_IS_TMC2130
//#define E4_IS_TMC2130
//#define X_IS_TMC2208
//#define X2_IS_TMC2208
//#define Y_IS_TMC2208
//#define Y2_IS_TMC2208
//#define Z_IS_TMC2208
//#define Z2_IS_TMC2208
//#define E0_IS_TMC2208
//#define E1_IS_TMC2208
//#define E2_IS_TMC2208
//#define E3_IS_TMC2208
//#define E4_IS_TMC2208
/**
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
#define X_CURRENT 1000 // rms current in mA. Multiply by 1.41 for peak current.
#define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define Y_CURRENT 1000
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Z_CURRENT 1000
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
//#define Y2_CURRENT 1000
//#define Y2_MICROSTEPS 16
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
//#define Z2_CURRENT 1000
//#define Z2_MICROSTEPS 16
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
//#define E0_CURRENT 1000
//#define E0_MICROSTEPS 16
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
//#define E1_CURRENT 1000
//#define E1_MICROSTEPS 16
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
//#define E2_CURRENT 1000
//#define E2_MICROSTEPS 16
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
//#define E3_CURRENT 1000
//#define E3_MICROSTEPS 16
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
//#define E4_CURRENT 1000
//#define E4_MICROSTEPS 16
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
/**
* Use Trinamic's ultra quiet stepping mode.
@ -1043,24 +1067,22 @@
#define STEALTHCHOP
/**
* Let Marlin automatically control stepper current.
* This is still an experimental feature.
* Increase current every 5s by CURRENT_STEP until stepper temperature prewarn gets triggered,
* then decrease current by CURRENT_STEP until temperature prewarn is cleared.
* Adjusting starts from X/Y/Z/E_CURRENT but will not increase over AUTO_ADJUST_MAX
* Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M906 S1 - Start adjusting current
* M906 S0 - Stop adjusting current
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 S0/1 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define AUTOMATIC_CURRENT_CONTROL
//#define MONITOR_DRIVER_STATUS
#if ENABLED(AUTOMATIC_CURRENT_CONTROL)
#define CURRENT_STEP 50 // [mA]
#define AUTO_ADJUST_MAX 1300 // [mA], 1300mA_rms = 1840mA_peak
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
@ -1075,8 +1097,8 @@
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 4
#define Z2_HYBRID_THRESHOLD 4
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
@ -1086,7 +1108,7 @@
/**
* Use stallGuard2 to sense an obstacle and trigger an endstop.
* You need to place a wire from the driver's DIAG1 pin to the X/Y endstop pin.
* If used along with STEALTHCHOP, the movement will be louder when homing. This is normal.
* X and Y homing will always be done in spreadCycle mode.
*
* X/Y_HOMING_SENSITIVITY is used for tuning the trigger sensitivity.
* Higher values make the system LESS sensitive.
@ -1095,27 +1117,34 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
//#define SENSORLESS_HOMING // TMC2130 only
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY 8
#define Y_HOMING_SENSITIVITY 8
#endif
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting.
*/
//#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
* A list of available functions can be found on the library github page
* https://github.com/teemuatlut/TMC2130Stepper
* https://github.com/teemuatlut/TMC2208Stepper
*
* Example:
* #define TMC2130_ADV() { \
* #define TMC_ADV() { \
* stepperX.diag0_temp_prewarn(1); \
* stepperX.interpolate(0); \
* stepperY.interpolate(0); \
* }
*/
#define TMC2130_ADV() { }
#define TMC_ADV() { }
#endif // HAVE_TMC2130
#endif // TMC2130 || TMC2208
// @section L6470

View file

@ -776,4 +776,69 @@
#if PIN_EXISTS(Z2_STEP)
REPORT_NAME_DIGITAL(Z2_STEP_PIN, __LINE__ )
#endif
#if PIN_EXISTS(X_SERIAL_TX)
REPORT_NAME_DIGITAL(X_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(X_SERIAL_RX)
REPORT_NAME_DIGITAL(X_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(X2_SERIAL_TX)
REPORT_NAME_DIGITAL(X2_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(X2_SERIAL_RX)
REPORT_NAME_DIGITAL(X2_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(Y_SERIAL_TX)
REPORT_NAME_DIGITAL(Y_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(Y_SERIAL_RX)
REPORT_NAME_DIGITAL(Y_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(Y2_SERIAL_TX)
REPORT_NAME_DIGITAL(Y2_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(Y2_SERIAL_RX)
REPORT_NAME_DIGITAL(Y2_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(Z_SERIAL_TX)
REPORT_NAME_DIGITAL(Z_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(Z_SERIAL_RX)
REPORT_NAME_DIGITAL(Z_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(Z2_SERIAL_TX)
REPORT_NAME_DIGITAL(Z2_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(Z2_SERIAL_RX)
REPORT_NAME_DIGITAL(Z2_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E0_SERIAL_TX)
REPORT_NAME_DIGITAL(E0_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E0_SERIAL_RX)
REPORT_NAME_DIGITAL(E0_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E1_SERIAL_TX)
REPORT_NAME_DIGITAL(E1_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E1_SERIAL_RX)
REPORT_NAME_DIGITAL(E1_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E2_SERIAL_TX)
REPORT_NAME_DIGITAL(E2_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E2_SERIAL_RX)
REPORT_NAME_DIGITAL(E2_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E3_SERIAL_TX)
REPORT_NAME_DIGITAL(E3_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E3_SERIAL_RX)
REPORT_NAME_DIGITAL(E3_SERIAL_RX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E4_SERIAL_TX)
REPORT_NAME_DIGITAL(E4_SERIAL_TX_PIN, __LINE__ )
#endif
#if PIN_EXISTS(E4_SERIAL_RX)
REPORT_NAME_DIGITAL(E4_SERIAL_RX_PIN, __LINE__ )
#endif

View file

@ -113,6 +113,57 @@
#define E1_ENABLE_PIN 30
#define E1_CS_PIN 44
#if ENABLED(HAVE_TMC2208)
/**
* TMC2208 stepper drivers
*
* Hardware serial communication ports.
* If undefined software serial is used according to the pins below
*/
//#define X_HARDWARE_SERIAL Serial1
//#define X2_HARDWARE_SERIAL Serial1
//#define Y_HARDWARE_SERIAL Serial1
//#define Y2_HARDWARE_SERIAL Serial1
//#define Z_HARDWARE_SERIAL Serial1
//#define Z2_HARDWARE_SERIAL Serial1
//#define E0_HARDWARE_SERIAL Serial1
//#define E1_HARDWARE_SERIAL Serial1
//#define E2_HARDWARE_SERIAL Serial1
//#define E3_HARDWARE_SERIAL Serial1
//#define E3_HARDWARE_SERIAL Serial1
/**
* Software serial
*/
#define X_SERIAL_TX_PIN 59
#define X_SERIAL_RX_PIN 63
#define X2_SERIAL_TX_PIN -1
#define X2_SERIAL_RX_PIN -1
#define Y_SERIAL_TX_PIN 64
#define Y_SERIAL_RX_PIN 40
#define Y2_SERIAL_TX_PIN -1
#define Y2_SERIAL_RX_PIN -1
#define Z_SERIAL_TX_PIN 44
#define Z_SERIAL_RX_PIN 42
#define Z2_SERIAL_TX_PIN -1
#define Z2_SERIAL_RX_PIN -1
#define E0_SERIAL_TX_PIN 66
#define E0_SERIAL_RX_PIN 65
#define E1_SERIAL_TX_PIN -1
#define E1_SERIAL_RX_PIN -1
#define E2_SERIAL_TX_PIN -1
#define E2_SERIAL_RX_PIN -1
#define E3_SERIAL_TX_PIN -1
#define E3_SERIAL_RX_PIN -1
#define E4_SERIAL_TX_PIN -1
#define E4_SERIAL_RX_PIN -1
#endif
//
// Temperature Sensors
//

View file

@ -26,7 +26,7 @@
#include "MarlinConfig.h"
#ifdef USBCON
#include "HardwareSerial.h"
#include <HardwareSerial.h>
#if ENABLED(BLUETOOTH)
#define MYSERIAL bluetoothSerial
#else

View file

@ -965,6 +965,16 @@ void Stepper::init() {
tmc2130_init();
#endif
// Init TMC2208 Steppers
#if ENABLED(HAVE_TMC2208)
tmc2208_init();
#endif
// TRAMS, TMC2130 and TMC2208 advanced settings
#if HAS_TRINAMIC
TMC_ADV()
#endif
// Init L6470 Steppers
#if ENABLED(HAVE_L6470DRIVER)
L6470_init();

View file

@ -129,6 +129,7 @@
#include <SPI.h>
#include <TMC2130Stepper.h>
#include "planner.h"
#include "enum.h"
#define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN)
@ -171,16 +172,16 @@
// Use internal reference voltage for current calculations. This is the default.
// Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609)
// https://www.trinamic.com/products/integrated-circuits/details/tmc2130/
void tmc2130_init(TMC2130Stepper &st, const uint16_t microsteps, const uint32_t thrs, const float &spmm) {
void tmc2130_init(TMC2130Stepper &st, const uint16_t microsteps, const uint32_t thrs, const float spmm) {
st.begin();
st.setCurrent(st.getCurrent(), R_SENSE, HOLD_MULTIPLIER);
st.microsteps(microsteps);
st.blank_time(36);
st.blank_time(24);
st.off_time(5); // Only enables the driver if used with stealthChop
st.interpolate(INTERPOLATE);
st.power_down_delay(128); // ~2s until driver lowers to hold current
st.hysterisis_start(0); // HSTRT = 1
st.hysterisis_low(1); // HEND = -2
st.hysterisis_start(3);
st.hysterisis_end(2);
st.diag1_active_high(1); // For sensorless homing
#if ENABLED(STEALTHCHOP)
st.stealth_freq(1); // f_pwm = 2/683 f_clk
@ -189,61 +190,260 @@
st.stealth_amplitude(255);
st.stealthChop(1);
#if ENABLED(HYBRID_THRESHOLD)
st.stealth_max_speed(12650000UL*st.microsteps()/(256*thrs*spmm));
st.stealth_max_speed(12650000UL*microsteps/(256*thrs*spmm));
#else
UNUSED(thrs);
UNUSED(spmm);
#endif
#elif ENABLED(SENSORLESS_HOMING)
st.coolstep_min_speed(1024UL * 1024UL - 1UL);
#endif
st.GSTAT(); // Clear GSTAT
}
#define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM)
void tmc2130_init() {
constexpr float steps_per_mm[] = DEFAULT_AXIS_STEPS_PER_UNIT;
#if ENABLED(X_IS_TMC2130)
_TMC2130_INIT( X, steps_per_mm[X_AXIS]);
#if ENABLED(SENSORLESS_HOMING)
stepperX.sg_stall_value(X_HOMING_SENSITIVITY);
#endif
_TMC2130_INIT( X, planner.axis_steps_per_mm[X_AXIS]);
#endif
#if ENABLED(X2_IS_TMC2130)
_TMC2130_INIT(X2, steps_per_mm[X_AXIS]);
_TMC2130_INIT(X2, planner.axis_steps_per_mm[X_AXIS]);
#endif
#if ENABLED(Y_IS_TMC2130)
_TMC2130_INIT( Y, steps_per_mm[Y_AXIS]);
#if ENABLED(SENSORLESS_HOMING)
stepperY.sg_stall_value(Y_HOMING_SENSITIVITY);
#endif
_TMC2130_INIT( Y, planner.axis_steps_per_mm[Y_AXIS]);
#endif
#if ENABLED(Y2_IS_TMC2130)
_TMC2130_INIT(Y2, steps_per_mm[Y_AXIS]);
_TMC2130_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]);
#endif
#if ENABLED(Z_IS_TMC2130)
_TMC2130_INIT( Z, steps_per_mm[Z_AXIS]);
_TMC2130_INIT( Z, planner.axis_steps_per_mm[Z_AXIS]);
#endif
#if ENABLED(Z2_IS_TMC2130)
_TMC2130_INIT(Z2, steps_per_mm[Z_AXIS]);
_TMC2130_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]);
#endif
#if ENABLED(E0_IS_TMC2130)
_TMC2130_INIT(E0, steps_per_mm[E_AXIS]);
_TMC2130_INIT(E0, planner.axis_steps_per_mm[E_AXIS]);
#endif
#if ENABLED(E1_IS_TMC2130)
{ constexpr int extruder = 1; _TMC2130_INIT(E1, steps_per_mm[E_AXIS_N]); }
{ constexpr int extruder = 1; _TMC2130_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); }
#endif
#if ENABLED(E2_IS_TMC2130)
{ constexpr int extruder = 2; _TMC2130_INIT(E2, steps_per_mm[E_AXIS_N]); }
{ constexpr int extruder = 2; _TMC2130_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); }
#endif
#if ENABLED(E3_IS_TMC2130)
{ constexpr int extruder = 3; _TMC2130_INIT(E3, steps_per_mm[E_AXIS_N]); }
{ constexpr int extruder = 3; _TMC2130_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); }
#endif
#if ENABLED(E4_IS_TMC2130)
{ constexpr int extruder = 4; _TMC2130_INIT(E4, steps_per_mm[E_AXIS_N]); }
{ constexpr int extruder = 4; _TMC2130_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); }
#endif
TMC2130_ADV()
}
#endif // HAVE_TMC2130
//
// TMC2208 Driver objects and inits
//
#if ENABLED(HAVE_TMC2208)
#include <SoftwareSerial.h>
#include <HardwareSerial.h>
#include <TMC2208Stepper.h>
#include "planner.h"
#define _TMC2208_DEFINE_HARDWARE(ST) TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL)
#define _TMC2208_DEFINE_SOFTWARE(ST) SoftwareSerial stepper##ST##_serial = SoftwareSerial(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN); \
TMC2208Stepper stepper##ST(&stepper##ST##_serial, ST##_SERIAL_RX_PIN > -1)
// Stepper objects of TMC2208 steppers used
#if ENABLED(X_IS_TMC2208)
#if defined(X_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(X);
#else
_TMC2208_DEFINE_SOFTWARE(X);
#endif
#endif
#if ENABLED(X2_IS_TMC2208)
#if defined(X2_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(X2);
#else
_TMC2208_DEFINE_SOFTWARE(X2);
#endif
#endif
#if ENABLED(Y_IS_TMC2208)
#if defined(Y_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(Y);
#else
_TMC2208_DEFINE_SOFTWARE(Y);
#endif
#endif
#if ENABLED(Y2_IS_TMC2208)
#if defined(Y2_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(Y2);
#else
_TMC2208_DEFINE_SOFTWARE(Y2);
#endif
#endif
#if ENABLED(Z_IS_TMC2208)
#if defined(Z_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(Z);
#else
_TMC2208_DEFINE_SOFTWARE(Z);
#endif
#endif
#if ENABLED(Z2_IS_TMC2208)
#if defined(Z2_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(Z2);
#else
_TMC2208_DEFINE_SOFTWARE(Z2);
#endif
#endif
#if ENABLED(E0_IS_TMC2208)
#if defined(E0_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(E0);
#else
_TMC2208_DEFINE_SOFTWARE(E0);
#endif
#endif
#if ENABLED(E1_IS_TMC2208)
#if defined(E1_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(E1);
#else
_TMC2208_DEFINE_SOFTWARE(E1);
#endif
#endif
#if ENABLED(E2_IS_TMC2208)
#if defined(E2_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(E2);
#else
_TMC2208_DEFINE_SOFTWARE(E2);
#endif
#endif
#if ENABLED(E3_IS_TMC2208)
#if defined(E3_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(E3);
#else
_TMC2208_DEFINE_SOFTWARE(E3);
#endif
#endif
#if ENABLED(E4_IS_TMC2208)
#if defined(E4_HARDWARE_SERIAL)
_TMC2208_DEFINE_HARDWARE(E4);
#else
_TMC2208_DEFINE_SOFTWARE(E4);
#endif
#endif
void tmc2208_serial_begin() {
#if ENABLED(X_IS_TMC2208) && defined(X_HARDWARE_SERIAL)
X_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(X2_IS_TMC2208) && defined(X2_HARDWARE_SERIAL)
X2_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(Y_IS_TMC2208) && defined(Y_HARDWARE_SERIAL)
Y_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(Y2_IS_TMC2208) && defined(Y2_HARDWARE_SERIAL)
Y2_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(Z_IS_TMC2208) && defined(Z_HARDWARE_SERIAL)
Z_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(Z2_IS_TMC2208) && defined(Z2_HARDWARE_SERIAL)
Z2_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(E0_IS_TMC2208) && defined(E0_HARDWARE_SERIAL)
E0_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(E1_IS_TMC2208) && defined(E1_HARDWARE_SERIAL)
E1_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(E2_IS_TMC2208) && defined(E2_HARDWARE_SERIAL)
E2_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(E3_IS_TMC2208) && defined(E3_HARDWARE_SERIAL)
E3_HARDWARE_SERIAL.begin(250000);
#endif
#if ENABLED(E4_IS_TMC2208) && defined(E4_HARDWARE_SERIAL)
E4_HARDWARE_SERIAL.begin(250000);
#endif
}
// Use internal reference voltage for current calculations. This is the default.
// Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609)
void tmc2208_init(TMC2208Stepper &st, const uint16_t microsteps, const uint32_t thrs, const float spmm) {
st.pdn_disable(true); // Use UART
st.mstep_reg_select(true); // Select microsteps with UART
st.I_scale_analog(false);
st.rms_current(st.getCurrent(), HOLD_MULTIPLIER, R_SENSE);
st.microsteps(microsteps);
st.blank_time(24);
st.toff(5);
st.intpol(INTERPOLATE);
st.TPOWERDOWN(128); // ~2s until driver lowers to hold current
st.hysterisis_start(3);
st.hysterisis_end(2);
#if ENABLED(STEALTHCHOP)
st.pwm_lim(12);
st.pwm_reg(8);
st.pwm_autograd(1);
st.pwm_autoscale(1);
st.pwm_freq(1);
st.pwm_grad(14);
st.pwm_ofs(36);
st.en_spreadCycle(false);
#if ENABLED(HYBRID_THRESHOLD)
st.TPWMTHRS(12650000UL*microsteps/(256*thrs*spmm));
#else
UNUSED(thrs);
UNUSED(spmm);
#endif
#else
st.en_spreadCycle(true);
#endif
st.GSTAT(0b111); // Clear
delay(200);
}
#define _TMC2208_INIT(ST, SPMM) tmc2208_init(stepper##ST, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM)
void tmc2208_init() {
#if ENABLED(X_IS_TMC2208)
_TMC2208_INIT(X, planner.axis_steps_per_mm[X_AXIS]);
#endif
#if ENABLED(X2_IS_TMC2208)
_TMC2208_INIT(X2, planner.axis_steps_per_mm[X_AXIS]);
#endif
#if ENABLED(Y_IS_TMC2208)
_TMC2208_INIT(Y, planner.axis_steps_per_mm[Y_AXIS]);
#endif
#if ENABLED(Y2_IS_TMC2208)
_TMC2208_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]);
#endif
#if ENABLED(Z_IS_TMC2208)
_TMC2208_INIT(Z, planner.axis_steps_per_mm[Z_AXIS]);
#endif
#if ENABLED(Z2_IS_TMC2208)
_TMC2208_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]);
#endif
#if ENABLED(E0_IS_TMC2208)
_TMC2208_INIT(E0, planner.axis_steps_per_mm[E_AXIS]);
#endif
#if ENABLED(E1_IS_TMC2208)
{ constexpr int extruder = 1; _TMC2208_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); }
#endif
#if ENABLED(E2_IS_TMC2208)
{ constexpr int extruder = 2; _TMC2208_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); }
#endif
#if ENABLED(E3_IS_TMC2208)
{ constexpr int extruder = 3; _TMC2208_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); }
#endif
#if ENABLED(E4_IS_TMC2208)
{ constexpr int extruder = 4; _TMC2208_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); }
#endif
}
#endif // HAVE_TMC2208
//
// L6470 Driver objects and inits

View file

@ -58,6 +58,12 @@
void tmc2130_init();
#endif
#if ENABLED(HAVE_TMC2208)
#include <TMC2208Stepper.h>
void tmc2208_serial_begin();
void tmc2208_init();
#endif
// L6470 has STEP on normal pins, but DIR/ENABLE via SPI
#if ENABLED(HAVE_L6470DRIVER)
#include <SPI.h>
@ -83,6 +89,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(X_IS_TMC2130)
extern TMC2130Stepper stepperX;
#elif ENABLED(HAVE_TMC2208) && ENABLED(X_IS_TMC2208)
extern TMC2208Stepper stepperX;
#endif
#define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN)
#define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE)
@ -114,6 +122,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(Y_IS_TMC2130)
extern TMC2130Stepper stepperY;
#elif ENABLED(HAVE_TMC2208) && ENABLED(Y_IS_TMC2208)
extern TMC2208Stepper stepperY;
#endif
#define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN)
#define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE)
@ -145,6 +155,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(Z_IS_TMC2130)
extern TMC2130Stepper stepperZ;
#elif ENABLED(HAVE_TMC2208) && ENABLED(Z_IS_TMC2208)
extern TMC2208Stepper stepperZ;
#endif
#define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN)
#define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE)
@ -177,6 +189,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(X2_IS_TMC2130)
extern TMC2130Stepper stepperX2;
#elif ENABLED(HAVE_TMC2208) && ENABLED(X2_IS_TMC2208)
extern TMC2208Stepper stepperX2;
#endif
#define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN)
#define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE)
@ -210,6 +224,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(Y2_IS_TMC2130)
extern TMC2130Stepper stepperY2;
#elif ENABLED(HAVE_TMC2208) && ENABLED(Y2_IS_TMC2208)
extern TMC2208Stepper stepperY2;
#endif
#define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN)
#define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE)
@ -243,6 +259,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(Z2_IS_TMC2130)
extern TMC2130Stepper stepperZ2;
#elif ENABLED(HAVE_TMC2208) && ENABLED(Z2_IS_TMC2208)
extern TMC2208Stepper stepperZ2;
#endif
#define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN)
#define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE)
@ -275,6 +293,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(E0_IS_TMC2130)
extern TMC2130Stepper stepperE0;
#elif ENABLED(HAVE_TMC2208) && ENABLED(E0_IS_TMC2208)
extern TMC2208Stepper stepperE0;
#endif
#define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN)
#define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE)
@ -306,6 +326,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(E1_IS_TMC2130)
extern TMC2130Stepper stepperE1;
#elif ENABLED(HAVE_TMC2208) && ENABLED(E1_IS_TMC2208)
extern TMC2208Stepper stepperE1;
#endif
#define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN)
#define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE)
@ -337,6 +359,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(E2_IS_TMC2130)
extern TMC2130Stepper stepperE2;
#elif ENABLED(HAVE_TMC2208) && ENABLED(E2_IS_TMC2208)
extern TMC2208Stepper stepperE2;
#endif
#define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN)
#define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE)
@ -368,6 +392,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(E3_IS_TMC2130)
extern TMC2130Stepper stepperE3;
#elif ENABLED(HAVE_TMC2208) && ENABLED(E3_IS_TMC2208)
extern TMC2208Stepper stepperE3;
#endif
#define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN)
#define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE)
@ -399,6 +425,8 @@
#else
#if ENABLED(HAVE_TMC2130) && ENABLED(E4_IS_TMC2130)
extern TMC2130Stepper stepperE4;
#elif ENABLED(HAVE_TMC2208) && ENABLED(E4_IS_TMC2208)
extern TMC2208Stepper stepperE4;
#endif
#define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN)
#define E4_ENABLE_WRITE(STATE) WRITE(E4_ENABLE_PIN,STATE)

39
Marlin/tmc_macros.h Normal file
View file

@ -0,0 +1,39 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
*
*/
#ifndef TMC_MACROS_H
#define TMC_MACROS_H
// Trinamic Stepper Drivers
#define HAS_TRINAMIC (ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) || ENABLED(IS_TRAMS))
#define X_IS_TRINAMIC (ENABLED( X_IS_TMC2130) || ENABLED( X_IS_TMC2208) || ENABLED(IS_TRAMS))
#define X2_IS_TRINAMIC (ENABLED(X2_IS_TMC2130) || ENABLED(X2_IS_TMC2208))
#define Y_IS_TRINAMIC (ENABLED( Y_IS_TMC2130) || ENABLED( Y_IS_TMC2208) || ENABLED(IS_TRAMS))
#define Y2_IS_TRINAMIC (ENABLED(Y2_IS_TMC2130) || ENABLED(Y2_IS_TMC2208))
#define Z_IS_TRINAMIC (ENABLED( Z_IS_TMC2130) || ENABLED( Z_IS_TMC2208) || ENABLED(IS_TRAMS))
#define Z2_IS_TRINAMIC (ENABLED(Z2_IS_TMC2130) || ENABLED(Z2_IS_TMC2208))
#define E0_IS_TRINAMIC (ENABLED(E0_IS_TMC2130) || ENABLED(E0_IS_TMC2208) || ENABLED(IS_TRAMS))
#define E1_IS_TRINAMIC (ENABLED(E1_IS_TMC2130) || ENABLED(E1_IS_TMC2208))
#define E2_IS_TRINAMIC (ENABLED(E2_IS_TMC2130) || ENABLED(E2_IS_TMC2208))
#define E3_IS_TRINAMIC (ENABLED(E3_IS_TMC2130) || ENABLED(E3_IS_TMC2208))
#define E4_IS_TRINAMIC (ENABLED(E4_IS_TMC2130) || ENABLED(E4_IS_TMC2208))
#endif