Nema 17 TMC2208 V2.0

Hello! How you all doing.

I became interested in electronics and now it's my new hobby. Anyhow, my first project is to make breadboard with Nema 17 motor and Nano 33 Iot with TMC2208 V2.0 stepper driver.

The issue here is that I believe I busted my first driver as it sparked when I tried to check the Vref on it. (Also before actually messing with ground and Vref pins the motor was going clockwise around very slowly and did nothing else) and before doing something again would really appreciate any tips or comments.

This is the code I copied to perform a quick test:

/*   
 *   Basic example code for controlling a stepper without library
 *      
 *   by Dejan, https://howtomechatronics.com
 */

// defines pins
#define dirPin  4
#define stepPin 3
 
void setup() {
  // Sets the two pins as Outputs
  pinMode(stepPin,OUTPUT); 
  pinMode(dirPin,OUTPUT);
}
void loop() {
  digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
  // Makes 200 pulses for making one full cycle rotation
  for(int x = 0; x < 800; x++) {
    digitalWrite(stepPin,HIGH); 
    delayMicroseconds(700);    // by changing this time delay between the steps we can change the rotation speed
    digitalWrite(stepPin,LOW); 
    delayMicroseconds(700); 
  }
  delay(1000); // One second delay
  
  digitalWrite(dirPin,LOW); //Changes the rotations direction
  // Makes 400 pulses for making two full cycle rotation
  for(int x = 0; x < 1600; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(500);
  }
  delay(1000);
}

Please note that in the image I used Arduino Nano 3.0 for illustration while I am using Nano 33 Iot.

This is TMC2208 V2.0 Sheet. Interesting enough depending on the version the pins might differ. Most tutorials use V1.0 or V1.2 and the Vref pin is not located at the same spot as V2.0

TMC2208 V2.0 Schematic

This is the formula I used to calculate the IRMS:

VREF = I * 8 * R
VREF = 1.5 * 8 * 0.11
1.32 * 0.70 = 0,924
VREF = 0.92

IRMS = VREF * 1.64A/2.5V
IRMS = 0.60A

So here is my questions:

  1. When I want to check the current for the TMC Driver, I only need to power the driver through Vm and GND? And disconnect the power from Arduino (USB) as well as disconnect the Motors?
    1.1 And to check that i need to use Vref pin on the Driver and the GND(next to Vm I presume)
  2. Do I actually need to use the EN pin to the GND? And does the connections look okeyish..?

If you wonder why I am using 19V power adapter, well that is what I had at hand. Also the 25V 1000 uF cap is the only Cap I have above the 20V while others that I store are 16V

Than you very much!

Don't run motor currents through a breadboard. They are designed for signal current, max a few single LED.
If You want helpers to check any details please post real schematics. Those Fritzings are useless for details.
Use plastic screwdriver when adjusting Vref!

Hey thanks for the reply!

Oh so breadboards are not to be used like that? Do you recommend to use jumper wires? As every single tutorial I found uses breadboard and they connect it directly.

About schematics, do you have any suggestions what website/software would be best for that? As I understood you want how everything connected unless you mean schematics for TMC and Nema 17 .

It is really weird that the TMC driver comes with a normal screwdriver when in fact as I suspected it should be used with plastic one.

For motor cables using screw blocks can be used.

Pen and paper are usually good enough for schematics. Skip the rphysical shape of the circuits. Pin designations are important. The powering parts are also important. Without proper power all further work is meaningless, to make things work.

1 Like

Will this be enough? I definitely can not draw a circuit diagram after a looked a one for Driver.. :upside_down_face:


Avoid all those tutorials. They were posted by people who do not understand what they are doing, and probably burned the breadboard tracks making the "tutorial".

Either solder connections between the motor, the motor driver and the motor power supply, or use screw terminals. Be sure to select the correct motor current limit!

Will this be enough?

The drawing looks fine.

1 Like

Hey thanks!
Anyhow, I still seem to have same issue where the stepper motor just goes clockwise slowly but smoothly and changing values does not seem to effect anything.

Is my Motor/Driver perhaps busted? (I have not tried with another driver motor in case i destroy it again) the drivers Vref is set to 0.99V per formula so yeah.

void setup()
{

  pinMode(21, OUTPUT); //Step 
  pinMode(20, OUTPUT); //Direction //HIGH = CC / LOW = Clockwise DIR

  setMotorDirection(false); //clockwise
}

void loop()
{
  doMotorStep(); //just turn continuously
}

//Pin 20 is Direction
void setMotorDirection(bool clockwise)
{
  delay(500);//ms
  if (clockwise) {
    digitalWrite(20, LOW);//clockwise - LOW for 2208 / HIGH for 4988
  } else {
    digitalWrite(20, HIGH);//counter clockwise - HIGH for 2208 / LOW for 4988
  }
}

//Pin 5 is Step
//Does one step in the currently set direction
void doMotorStep()
{
  digitalWrite(21, HIGH);
  delayMicroseconds(200); //lower = faster, but louder
  digitalWrite(21, LOW);
  delayMicroseconds(200);
}

Ok so here was the thing, apparently when I was looking at the Arduino Nano Io3 Data sheet, it shows D3 as pin 21 which is of course what I used in the Arduino IDE, but in reality D3 is pin 3. After changing the motor + driver and using Step pin as 3 and not 21 it does what it should!

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