TMC2208 help and power Supply

I am starting a project and need to control a stepper motor to go continuously. I am new to this and trying to learn on the go but seemed to have hit a wall. I am using an Uno and TMC2208 to drive a Nema 17. I attached my code and a picture of my wire configuration. I am also unsure of the power supply that I needed for the Vm pin. Currently, I have a 12v 5 amp, and a 9v 4v power supply.

The code that I am running rotates the motor but it is very noisy and doesn't get a full rotation in before it start shaking back and forth.

I have determined that the green and black wire are connected and the red and blue are connected. I have the wire configured as this:

Blue: M1A
Red: M2A
Black: M1B
Green: M2B

// Define motor pins
#define DIR_PIN 2
#define STEP_PIN 3
#define EN_PIN 4

// Set motor speed
int stepDelay = 1000; 

void setup() {
  // Set up the motor pins
  pinMode(DIR_PIN, OUTPUT);
  pinMode(STEP_PIN, OUTPUT);
  pinMode(EN_PIN, OUTPUT);
  
  // Set initial pin states
  digitalWrite(EN_PIN, LOW);   
  digitalWrite(DIR_PIN, HIGH); 
}

void loop() {
  // Rotate the motor continuously in one direction
  digitalWrite(STEP_PIN, HIGH);
  delayMicroseconds(stepDelay);
  digitalWrite(STEP_PIN, LOW);
  delayMicroseconds(stepDelay);
}

Thank You. Nice to see.

Please use schematics. Bird nests are not what forum expects.

The higher voltage the better, up to the limit of the driver.

Please explain what that stands for. Unfortunately there's no standard for the colors. Any combination might be the case. Using a DMM identifying the par of cables belonging to the same coil can be used. Or, rotate the axle and note what it feels like. The short to of the 4 cables to each other and turn the shaft. Is it harder? Then You have found a pair.

It looks like you might be powering everything via USB and through the Uno which is a bad idea. But you also mentioned a 12v power supply. I think you'll need to draw a schematic and stop running motor power through the Arduino if you are doing that.

How have you set up the 2208?

Where did you set the current?
What microstep setting are you using?

The code that I am running rotates the motor but it is very noisy and doesn't get a full rotation in before it start shaking back and forth.

What do you see with a longer stepDelay?

That's 500 steps per second or 150 RPM for a full stepping motor (200 steps per revolution), too fast without acceleration. Try:
int stepDelay = 4000;

I do not have the 12v 5amp or the 9v 4amp power supply photographed. I am only powering the TMC2208 with the usb, they are connected to the ViO and GND pins on the driver.

The black and green wires are pairs for a coil while the red and blue ones are pairs for the other coil. When I use the 12v 5a power supply the TMC2208 gets warm with the heat sink on. I am not sure how to test limit of the driver. Is it the same as the Vref? I have it set to 0.89.

Okey. I supposed You have verified using one method or the other.

Okey. What about the stepper motor?

No! You can't measure that pulsed and current limited current by DMM Amps measuring. Drop measuring and go for finding out how to set the desired current.

You have been asked several times to post schematics. When will that happen?

The stepper motor does not feel hot.

I used EasyEDA, they do not have an uno so I substituted for the nano assuming that was okay.

Thanks.
Please read the TMC2208 datasheet again. To me connecting 5 volt to Vref looks very wrong. What do You refer to in that respect?
The controller has no power supplied in the schematics.....

Sorry, I meant for the Arduino +5V to be connected to the VCC_IO pin and the +12v power supply to be connected to the VS pin(Motor supply voltage).

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