Welcome! Log In Create A New Profile


Marlin bugfix 2.0 and TMC2130 error on compiling

Posted by isketch93 
Marlin bugfix 2.0 and TMC2130 error on compiling
January 08, 2019 05:58PM
I've got four TMC2130 drivers on my board, all configured as standalone except for the Z one, which I configured (solder pads and bridges) and wired to be used with SPI. This is new for me, I wanted to try sensorless homing and probing for the fun of it. To my dissappointment though, I can't even reach the fun part of testing and tuning, since compiling Marlin fails almost immediately with this error:
In file included from sketch\src\inc\marlinconfig.h:41:0,

                 from sketch\src\HAL\HAL_AVR\HAL.cpp:29:

sketch\src\inc\SanityCheck.h:1868:4: error: #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."

#error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."


exit status 1

This surprised me, because I definitely enabled TMC drivers with StallGuard both in configuration and configuration_adv, my changes highlighted:

 * Stepper Drivers
 * These settings allow [...], 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE']
#define Z_DRIVER_TYPE  TMC2130
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
//#define E4_DRIVER_TYPE A4988
//#define E5_DRIVER_TYPE A4988

// @section tmc_smart

 * To use TMC2130 stepper drivers in SPI mode [...]

  #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       true  // Interpolate X/Y/Z_MICROSTEPS to 256

  [[ default current and microsteps which I left untouched, only cut here to save screen space  ]]

   * Override default SPI pins for TMC2130 and TMC2660 drivers here.
   * The default pins can be found in your board's pins file.
  //#define X_CS_PIN          -1
  //#define Y_CS_PIN          -1
  #define Z_CS_PIN          40
  //#define X2_CS_PIN         -1
  //#define Y2_CS_PIN         -1
  //#define Z2_CS_PIN         -1
  //#define Z3_CS_PIN         -1
  //#define E0_CS_PIN         -1
  //#define E1_CS_PIN         -1
  //#define E2_CS_PIN         -1
  //#define E3_CS_PIN         -1
  //#define E4_CS_PIN         -1
  //#define E5_CS_PIN         -1

   * Use software SPI for TMC2130.
   * The default SW SPI pins are defined the respective pins files,
   * but you can override or define them here.
  #define TMC_USE_SW_SPI
  #define TMC_SW_MOSI       66
  #define TMC_SW_MISO       44
  #define TMC_SW_SCK        64

   * Use Trinamic's ultra quiet stepping mode.
   * When disabled, Marlin will use spreadCycle stepping mode.
  //#define STEALTHCHOP_XY
  //#define STEALTHCHOP_E

   * Optimize spreadCycle chopper parameters by [...] hysteresis_start[1..8] }

   * Monitor Trinamic TMC2130 and TMC2208 drivers [...] Report driver parameters (Requires TMC_DEBUG)

    //#define CURRENT_STEP_DOWN     50  // [mA]
    //#define STOP_ON_ERROR

   * The driver will switch to spreadCycle [...] to live tune the setting

  [[ thresholds left untouched  ]]

   * Use StallGuard2 to sense [...] to live tune the setting
  #define SENSORLESS_HOMING // TMC2130 only

   * Use StallGuard2 to [...] to enable this feature.
  #define SENSORLESS_PROBING // TMC2130 only

    #define X_STALL_SENSITIVITY  8
    #define Y_STALL_SENSITIVITY  8
    #define Z_STALL_SENSITIVITY  1

   * Enable M122 debugging command for TMC stepper drivers.
   * M122 S0/1 will enable continous reporting.
  #define TMC_DEBUG

   * M915 Z Axis Calibration [...] add extra Z height to Z_MAX_POS.

   * You can set your [...]
   *   stepperY.interpolate(0); \
   * }
  #define TMC_ADV() {  }

#endif // HAS_TRINAMIC

I'm seeking help from you guys, I haven't got a ton of experience in configuring Marlin, especially the 2.0 version, and I hope you can find something I missed.
open | download - Configuration.h (75.8 KB)
open | download - Configuration_adv.h (80.5 KB)
Re: Marlin bugfix 2.0 and TMC2130 error on compiling
January 29, 2019 03:16PM
I had the same problem. It has been fixed, grab the latest version.
Re: Marlin bugfix 2.0 and TMC2130 error on compiling
February 27, 2019 06:49PM
Has this error been reintroduced in a later bugfix release?

I downloaded 2.0 today and ported over my settings from 1.1.9. I'm getting this error even though I've set TMC2130 on both X_DRIVER_TYPE and Y_DRIVER_TYPE.
Re: Marlin bugfix 2.0 and TMC2130 error on compiling
February 28, 2019 07:03PM
So this was my bad. After digging through the source code to figure out what was wrong, I realized that I had copied the "X_HOMING_SENSITIVITY" settings from 1.1.9.
These are renamed to X_STALL_SENSITIVITY. Maybe someone else will benefit from my mistake at least. smiling smiley
Sorry, only registered users may post in this forum.

Click here to login