TMC2130 Testing (UNO) and Implementation (RUMBA)

Electronics, Components etc
Post Reply
greeno76
Posts: 4
Joined: Thu Sep 27, 2018 10:56 am

TMC2130 Testing (UNO) and Implementation (RUMBA)

Post by greeno76 » Thu Sep 27, 2018 11:18 am

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:
  • 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;
	}
}
Attachments
IMG_20180926_205638.jpg
IMG_20180926_205638.jpg (597.91 KiB) Viewed 238 times

oakdesign
Posts: 109
Joined: Thu Jun 15, 2017 10:21 am

Re: TMC2130 Testing (UNO) and Implementation (RUMBA)

Post by oakdesign » Thu Sep 27, 2018 3:57 pm

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
Last edited by oakdesign on Thu Sep 27, 2018 4:40 pm, edited 1 time in total.
Opa's bester Rat: Probieren geht über Studieren, Grandpas best advice: the proof of the pudding is in the eating

oakdesign
Posts: 109
Joined: Thu Jun 15, 2017 10:21 am

Re: TMC2130 Testing (UNO) and Implementation (RUMBA)

Post by oakdesign » Thu Sep 27, 2018 4:06 pm

maybe try to use hardware SPI on the UNO which are
13=SCK 12=MISO 11=MOSI
Opa's bester Rat: Probieren geht über Studieren, Grandpas best advice: the proof of the pudding is in the eating

greeno76
Posts: 4
Joined: Thu Sep 27, 2018 10:56 am

Re: TMC2130 Testing (UNO) and Implementation (RUMBA)

Post by greeno76 » Thu Sep 27, 2018 4:39 pm

Hi,

Thanks for your comments.
oakdesign wrote:
Thu Sep 27, 2018 3:57 pm
Hm you 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
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.
oakdesign wrote:maybe try to use hardware SPI on the UNO which are
13=SCK 12=MISO 11=MOSI
I'll give that a go, thanks!

Many thanks,

jason

oakdesign
Posts: 109
Joined: Thu Jun 15, 2017 10:21 am

Re: TMC2130 Testing (UNO) and Implementation (RUMBA)

Post by oakdesign » Thu Sep 27, 2018 4:45 pm

greeno76 wrote:
Thu Sep 27, 2018 4:39 pm
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.
jason
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.
Opa's bester Rat: Probieren geht über Studieren, Grandpas best advice: the proof of the pudding is in the eating

greeno76
Posts: 4
Joined: Thu Sep 27, 2018 10:56 am

Re: TMC2130 Testing (UNO) and Implementation (RUMBA)

Post by greeno76 » Tue Oct 02, 2018 1:00 pm

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: 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  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;
	}
}
TMC2130 Pin wiring
IMG_20181002_112941.jpg
IMG_20181002_112941.jpg (449.7 KiB) Viewed 201 times
Arduino wiring
IMG_20181002_112941.jpg
IMG_20181002_112941.jpg (449.7 KiB) Viewed 201 times
Stepper Motor and Power (12v right VM , 5V left VIO)
IMG_20181002_112941.jpg
IMG_20181002_112941.jpg (449.7 KiB) Viewed 201 times
Any advice gratefully received.

Best wishes,

Jason
Attachments
IMG_20181002_113012.jpg
IMG_20181002_113012.jpg (510.65 KiB) Viewed 201 times
IMG_20181002_112926.jpg
IMG_20181002_112926.jpg (874.67 KiB) Viewed 201 times

greeno76
Posts: 4
Joined: Thu Sep 27, 2018 10:56 am

Re: TMC2130 Testing (UNO) and Implementation (RUMBA)

Post by greeno76 » Tue Oct 02, 2018 1:02 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests