TMC2130

Hi,

I’m trying to get a stepper motor to work with a TMC2130 and Arduino Uno. I’m trying to keep simple. Pin 8 is direction, pin 9 is step.

Here’s the video where I got this project from.

Here’s where the sket he’s using. GitHub - contractorwolf/SilentStepper: slow moving silent stepper motor project using AccelStepper library

Here’s my video trying to make this work.

Here’s the code.

#include <TMC2130.h>

#include <AccelStepper.h>

// Define a stepper and the pins it will use
AccelStepper stepper(1, 9, 8);

char buf[50];

long lastMeasuredPosition = 0;

void setup()
{

int speed = 1000;

stepper.setMaxSpeed(speed);
stepper.setAcceleration(speed);
Serial.begin(9600);

}

void loop()
{
lastMeasuredPosition = stepper.currentPosition();

stepper.move(1);
stepper.run();

delay(200);

sprintf(buf, “position: %lu”, lastMeasuredPosition);
Serial.println( buf );

I’m using a 12volt battery for this.

Can you post a new link of the youtube-video where you start the sketch and th emovement of the motor can be seen?
or describing in words what the motor does?

Pin no 1 is a bad choice because it is the standard serial interface
start with pin number 2

best regards Stefan

Hi StefanL38,

Thanks for your reply. Here’s the video that I made for someone that was helping me but didn’t hear back from him.

I got the code from a video and to be honest I’m not sure what pin 1 is for. On other sketches, all I have is 9, 8. As you can see the stepper does nothing. There’s no tension on it. As if it’s getting to signal at all.

I’ll change it to 2 and shoot another video a little later.

Let me know what you think…Thanks…Antonio

Hi Antonio,

the video you postet is nine minutes long. I did not watch this video because of the length.
Showing code on a screen in a video is very hard to read.

Can you provide a datasheet of the stepperdriver you are using.

Did you connect ground of the stepperdriver with ground of the arduino?
Be careful only ground shall be connected not the plus of the supply-voltage.

Stepperdrivers are sensitive to induktive voltage-spikes. Never connect or disconnect the motorwires while
the powersupply of the steppermotor is switched on. The stepperdriver can be damaged through voltagespikes that occur when disconnecting or connecting the motorwires while current ist still running.

usually bipolar steppermotor have four wires. two pairs. each pair are begin and end of a coil inside the steppermotor.

Did you check with an digital multimeter which wires belong to a coil?

The microcontroller-word is not superstandardized like USB-devices. You have to check several things
what is what. What things these are depends on the devices. There is no general rule for that.

best regards Stefan