Welcome! Log In Create A New Profile

Advanced

TMC2130 drivers no bi-directional motion

Posted by rrcaveman 
TMC2130 drivers no bi-directional motion
December 23, 2019 04:24PM
I have a Rumba board (not a Rumba +), and I am trying to drive a stepper motor using TMC2130 drivers (I have both V1.1 and V1.0), and I am unable to drive the motor in both directions. I managed to get the sample Stepper as well as AccelStepper demos to spin the motor CCW, but nothings seems to work to drive the motor CW.

#define MOTOR_0_DIR_PIN (16)
#define MOTOR_0_STEP_PIN (17)
#define MOTOR_0_ENABLE_PIN (48)
#define MOTOR_0_LIMIT_PIN (37)
I got the motor turning in a single direction quite well using both the Stepper library example, and the AccelStepper library example using the pin assignment from the MarginallyClever firmware configure.h file:
[github.com]

Stepper myStepper = Stepper(200, 16, 17, 48, 37)
AccelStepper myStepper = AccelStepper(AccelStepper::, 16, 17, 48, 37)

[www.airspayce.com]

I tried every combination of pins to wire the motors, but I am unable to get bi-directional movement. I also tried every combination of dip switch underneath the motor driver as well.

It seems the purchase of the TMC2130 drivers are a mistake. Is there any option to get them working, or any recommendation for another driver set that works out-of-the-box?

Any help is appreciated.

Thanks,

-Kevin
Re: TMC2130 drivers no bi-directional motion
December 23, 2019 08:20PM
that library is for driving stepper motors with h-bridges, It is not for step and direction based stepper drivers.

I am presuming your running the TMC2130 in standalone mode, so it just requires step, direction and enable signals.

You don't need a library for basic moves...
try this. It just moves the stepper back and forth, It a striped down and modified ramps test, with pins changed for RUMBA

#define X_STEP_PIN      17   
#define X_DIR_PIN          16
#define X_ENABLE_PIN       48

#define LED_PIN            13

void setup() {
 
  pinMode(X_STEP_PIN  , OUTPUT);
  pinMode(X_DIR_PIN    , OUTPUT);
  pinMode(X_ENABLE_PIN    , OUTPUT);
  pinMode(LED_PIN  , OUTPUT);
  
  digitalWrite(X_ENABLE_PIN    , LOW);
}

void loop () {
  
  if (millis() %1000 <500) 
    digitalWrite(LED_PIN, HIGH);
  else
   digitalWrite(LED_PIN, LOW);
  
  if (millis() %10000 <5000) {
    digitalWrite(X_DIR_PIN    , HIGH);
  }
  else {
    digitalWrite(X_DIR_PIN    , LOW);
  }
  
    digitalWrite(X_STEP_PIN    , HIGH);
  delay(1);
    
    digitalWrite(X_STEP_PIN    , LOW);
}

Edited 6 time(s). Last edit at 12/23/2019 08:59PM by Dust.
Re: TMC2130 drivers no bi-directional motion
December 23, 2019 09:24PM
If you need spi communications you need to look into [github.com]
Sorry, only registered users may post in this forum.

Click here to login