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:
- Arduino UNO powered by USB
- Watterott TMC 2130
- Nema17 stepper motor- wired as specified
- 12V /2A power supply to VM/GND
- Code is included below for reference.
- Image below (attached) shows wiring - continuity and input voltages have been checked.
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: Select all
/**
* 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;
}
}