Controlling TMC2209 driver with Arduino

I am trying to control a stepper motor using a TMC2209 with an Arduino Uno, however I can't get it to work.

The motor driver is a TMC2209 V1.3 and is hooked up to a power supply set to 15V.

Below is how I wired the driver and motor and the code programmed onto the Arduino.

The schematic shows the step and dir pins wired to D2 and D3 but I wired them to D12 and D13 respectively.

#include <AccelStepper.h>
#include <MultiStepper.h>

int stepPin = 12;
int dirPin = 13;

AccelStepper motor1(1, stepPin, dirPin);

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);

  motor1.setMaxSpeed(1000);
}

void loop() {
  motor1.setSpeed(800);
  motor1.runSpeed();
}

Based on my research I think it should be working. I have tried using a different TMC2209 driver, but it still didn't work. If anyone could let me know if they see anything wrong or have any ideas why it wouldn't be working I would really appreciate it. Thank you.

Justt to cheer You up...
The TMC2209 is a very capable stepper driver. By som strange reason quite a number of members have problems like You, or similar problems.
I'm not an expert on that driver and it's very late here.
Have patience and wait a little for the Guru to step in.

Using pin 13 is bad as it is cycled by the boot loader etc. Pick another pin and all should go well.

Change that to:

motor1.setSpeed(100);

And try it.

Hi, @tomlightyear

Can you please post a link to data/specs of the stepper motor?

Tom.... :smiley: :+1: :coffee: :australia:

These can be configured as STEP/DIR or UART, check you have STEP/DIR enabled.

I just tried it with pins 11 and 12, but it still didn't work.

17HS24-2104S_Full_Datasheet (1).pdf (140.3 KB)

https://www.omc-stepperonline.com/nema-17-bipolar-1-8deg-65ncm-92oz-in-2-1a-3-36v-42x42x60mm-4-wires-17hs24-2104s

It's a Nema 17 motor I got from Amazon. The brand is Stepperonline. I know the stepper works because I tested it with an A4988 driver and it works.

Unfortunately that didn't fix the problem

How do you check that Step/Dir is enabled?

Sorry I got that wrong, I think STEP/DIR are always enabled, you should be ok.

Actually I just got a 2209 to play with, if I can find some time.

Turns out the Enable pin wasn't connected correctly. It works now. Thanks for all the suggestions.

Have you tried using the TMC2209 V1.3 with UART?
I connected TX@ArduinoUnoR4Minima to RX@TMC2209V1.3 and RX@Arduino to TX@TMC.
In the .ino i use the TMCStepper.h library.
The command test_connection() gives a positive result, but i cant adjust the rms_current for example. It appears that i can read from the TMC but not change it's configurations.

Does anyone else have this problem?

Thank you all in advance for your help.

Hi,

This code seems to be very effective, but I have one question. Is there a way to control multiple motors at the same time with the MultiStepper library.