TMC2209 Stepper driver

Hi,

I'm unable to use TMC2209 driver.
My config is :

  • TMC2209 MKS V2.0 with 1.3V Vref
  • Stepper motor stepperonline 17HE15-1504S
  • Arduino Uno powered by USB port
  • 14V Li-ion battery

Wirings :

Code :

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

int enablePin = 2;

int stepPin = 4;
int dirPin = 3;

int ms1Pin = 6;
int ms2Pin = 5;

AccelStepper motor1(1, stepPin, dirPin);

void setup() {
  // put your setup code here, to run once:
  
  pinMode(ms1Pin, OUTPUT);
  pinMode(ms2Pin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(enablePin, OUTPUT);
  
  
  motor1.setMaxSpeed(1000);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(ms1Pin, HIGH);
  digitalWrite(ms2Pin, HIGH);
  digitalWrite(enablePin, LOW);

  motor1.setSpeed(800);
  motor1.runSpeed();
}

What's the problem ? Nothing happens. I've tried a very similar set up (as few modification as possible to adapt it) with a A4988 driver and it works. I've tried other libraries and codes, other wirings... Anything wrong here ? What should I check ?

Thanks !!

I wired up a circuit with an Uno, a TMC2209 driver and a NEMA 17 stepper motor (real hardware) in accordance with your posted code. Motor power from an old PC AT power supply at 12V. Loaded and ran your code with no changes. The motor runs fine and responds to changes in microstepping by changes of the MS1 and MS2 pin states. Reverse the motor by sending negative speed value.

 motor1.setSpeed(-800);

Carefully check your wiring and the condition of jumpers and other wires.
Monitor battery voltage while attempting to run the motor.

Did you Ohm out the coils before connecting the motor? Have you set the coil current limit?

1 Like

Can you post clear photos to show the wiring?

The coil pins on the motor are crossed as I've drawn them ; it has been checked by 3 ways :

  • datasheet
  • resistance measuring (once the driver is connected to the motor, there is ~3 ohms between 1B/1A and same between 2A/2B, and too much - "1." for other combinations)
  • it works like that with A4988 driver

I've tried to set -800 as speed, nothing changes. I've also tried to see if it was a torque issue by making the motor turn with my hand. Nope, it just won't turn by its own, there is no power.

Vref is at 1.3V as I've said. I've measured some other voltages (all of them are measured directly on the driver's pins) with voltmeter in continuous mode, with both power supply and arduino turned on.

  • enable pin/GND = 0V
  • Vdd/GND = 4.9V
  • Vmot/GND = 12.9V
  • MS1/GND = 4.9V
  • MS2/GND = 4.9V
  • 1A/1B = 0V
  • 2A/2B = 0V
  • 1A/GND = 13V
  • 1B/GND = 13V
  • 2A/GND = 0V
  • 2B/GND = 0V
  • Dir/GND = 4.9V
  • Step/GND = 0.06V

What is your driver's brand @groundFungus ? There are some different TMC2209 turning around I think. Btw thanks for having tried my setup.

Here are some photos but difficult to make anything clear as I can't use bread board with this driver. Try to use colors for reading them (they are btw very similar in the scheam, except for arduno's 5V/gnd and motor wires). I can't post more than 1 by message so...

These are the TMC2209 drivers that I bought

I use mine on a breadboard by standing them off with long tail female headers.


TMC2209 stand off with header

OK I finally got a new one (the same), I did the same wiring and same code again, now it's working.
I guess I've fried the other one. It's the third one I'm destroying :rofl:
The other 2 I knew I did something wrong, but for this one I can't figure out how it has happened.
Anything to be carefull about this ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.