teemuatlut / TMC2130Stepper

Arduino library for Trinamic TMC2130 Stepper driver
MIT License
159 stars 50 forks source link

StallGuard can't seems to work while in TMCL-IDE the same config works #103

Open jonnydman opened 2 years ago

jonnydman commented 2 years ago

hi,

I have an ESP32 with SPI communication to TMC2130 (connected to their dev board).

I'm using the driver to run the motor, with FastAccelStepper for stepping abilities. however, no matter what configuration I write, the following happens:

  1. when I try to read DRV_STATUS, the SG_Result is always 0.
  2. the StallGuard flag is always off.

it does however display the Actual CS correctly.

on the other, when I configure the same params at TMCL-IDE I have a dynamic value of SG_Result and the StallGuard flag detects the stall.

this is my setup:

        _driver.begin();
        _driver.shaft(1);
        _driver.microsteps(2);
        // setup from TMCL IDE
        _driver.ihold(3);
        _driver.irun(23);
        _driver.iholddelay(7);
        _driver.pwm_ampl(200);
        _driver.diag1_stall(1);
        _driver.diag1_active_high(1);
        _driver.coolstep_min_speed(300);
        _driver.stealthChop(false);
        _driver.semin(0);
        _driver.semax(0);
        _driver.sedn(0);
        _driver.tbl(2);
        _driver.hstrt(5);
        _driver.hend(3);
        _driver.toff(5);

do you have any ideas?

jonnydman commented 2 years ago

oh man.. I just understood that DCEN_CFG4 leg must be tied to GND for not working with DcStep.

now I get SG_Result values