TMC2130 Testing (UNO) and Implementation (RUMBA)

#1

Hi,

I’ve scoured the internet trying to find seams of information on this. There appears to be so little that I can only assume that I’m missing something so obvious that no-one bothers to ask about it!

I wondered if anybody on this forum might have some relevant knowledge or experience?

Problem: I can’t get TMC2130’s to function on the Rumba board so I’m taking it back to basics by using the simple TMC2130 examples that are provided with the TMC2130 lib on the Arduino UNO. However, I can’t get the 'Software_SPI" example working.

Equipment:
[list]Arduino UNO powered by USB[/list]
[list]Watterott TMC 2130[/list]
[list]Nema17 stepper motor- wired as specified[/list]
[list]12V /2A power supply to VM/GND[/list]
[list]Code is included below for reference.[/list]
[list]Image below (attached) shows wiring - continuity and input voltages have been checked.[/list]

Results: Nothing whatsoever!

Please help if you have any experience of these drivers in a similar configuration. Ultimately I’d love to confidently install them into a suitably configured Rumba board. I’ve already fried one Rumba board, hence I’m keen to be confident with the TMC2130 implementation in this bare-bones arrangement first. Any help is greatly appreciated!

  • Jason (UK)

**Code **(from Lib with edited pins for UNO):

[code]/**

  • Author Teemu Mäntykallio
  • Initializes the library and turns the motor in alternating directions.
    */

#define EN_PIN 7 // Nano v3: 16 Mega: 38 //enable (CFG6)
#define DIR_PIN 6 // 19 55 //direction
#define STEP_PIN 5 // 18 54 //step
#define CS_PIN 8 // 17 64 //chip select
#define MOSI_PIN 9
#define MISO_PIN 10
#define SCK_PIN 11

bool dir = true;

#include <TMC2130Stepper.h>
TMC2130Stepper driver = TMC2130Stepper(EN_PIN, DIR_PIN, STEP_PIN, CS_PIN, MOSI_PIN, MISO_PIN, SCK_PIN);

void setup() {
Serial.begin(9600);
while(!Serial);
Serial.println(“Start…”);
driver.begin(); // Initiate pins and registeries
driver.rms_current(600); // Set stepper current to 600mA. The command is the same as command TMC2130.setCurrent(600, 0.11, 0.5);
driver.stealthChop(1); // Enable extremely quiet stepping

digitalWrite(EN_PIN, LOW);

Serial.print("DRV_STATUS=0b");
Serial.println(driver.DRV_STATUS(), BIN);

}

void loop() {
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(10);
uint32_t ms = millis();
static uint32_t last_time = 0;
if ((ms - last_time) > 2000) {
if (dir) {
Serial.println(“Dir -> 0”);
driver.shaft_dir(0);
} else {
Serial.println(“Dir -> 1”);
driver.shaft_dir(1);
}
dir = !dir;
last_time = ms;
}
}[/code]

#2

Hm Are suppling VIO and VM from the same source? VIO should be 5V from the UNO and not 12V from the source you are suppling to VM

#3

maybe try to use hardware SPI on the UNO which are
13=SCK 12=MISO 11=MOSI

#4

Hi,

Thanks for your comments.

the power supplies are wired as you’ve kindly suggested. The breadboard power rails are separate supplying 5v (from UNO) to the left and 12v (external) to the right as it’s presented in the photo - apologies, the break in the rails isn’t clear in that image.

I’ll give that a go, thanks!

Many thanks,

jason

#5

I just wasn’t sure. Its clear that the breadboard breaks the power lines in the middle but as the left and right power supply isn’t visible. I’ll maybe try to rebuild your setup tomorrow. As I have everything laying around. So far have made my tests, development and debugging with TMC’s always with an atmega2560 setup.

#6

Hi,
I’ve run a clean test on this. New TMC2130, different Arduino UNO. SPI pins as suggested. Details below. The result is the same as previously, ie. nothing. I can’t figure out what’s going on.

Is there another way to test the stepper motor drivers to verify they are working properly? I can’t seem to get off the starting blocks with this one, never mind implement it in the 3D printer Rumba board!

Any help is much appreciated if you have any experience with these drivers.

[code]/**

  • Author Teemu Mäntykallio
  • Initializes the library and turns the motor in alternating directions.
    */

#define EN_PIN 7 // Nano v3: 16 Mega: 38 //enable (CFG6)
#define DIR_PIN 6 // 19 55 //direction
#define STEP_PIN 5 // 18 54 //step
#define CS_PIN 8 // 17 64 //chip select
#define MOSI_PIN 11 // SDI
#define MISO_PIN 12 // SDO
#define SCK_PIN 13 // SCK

bool dir = true;

#include <TMC2130Stepper.h>
TMC2130Stepper driver = TMC2130Stepper(EN_PIN, DIR_PIN, STEP_PIN, CS_PIN, MOSI_PIN, MISO_PIN, SCK_PIN);

void setup() {
Serial.begin(9600);
while(!Serial);
Serial.println(“Start…”);
driver.begin(); // Initiate pins and registeries
driver.rms_current(600); // Set stepper current to 600mA. The command is the same as command TMC2130.setCurrent(600, 0.11, 0.5);
driver.stealthChop(1); // Enable extremely quiet stepping

digitalWrite(EN_PIN, LOW);

Serial.print("DRV_STATUS=0b");
Serial.println(driver.DRV_STATUS(), BIN);

}

void loop() {
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(10);
uint32_t ms = millis();
static uint32_t last_time = 0;
if ((ms - last_time) > 2000) {
if (dir) {
Serial.println(“Dir -> 0”);
driver.shaft_dir(0);
} else {
Serial.println(“Dir -> 1”);
driver.shaft_dir(1);
}
dir = !dir;
last_time = ms;
}
}[/code]

TMC2130 Pin wiring
image
Arduino wiring
image
Stepper Motor and Power (12v right VM , 5V left VIO)
image

Any advice gratefully received.

Best wishes,

Jason

#7

Apologies, the attachment function on this board seems to be doing strange things!